Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

feat: CStack: make direction prop responsive #390

Open
@Lutonite

Description

Describe the bug
Whenever I try to use the CStack component using an array of strings for the direction prop, it errors out with the following messages: this.direction.startsWith is not a function, and this.direction.endsWith is not a function. For example:

<template>
 <CStack :direction="['column', 'row']">
 <span>Content 1</span>
 <span>Content 2</span>
 </CStack>
</template>

I think the issue comes from the computed variables _isInline and _isReversed in https://github.com/chakra-ui/chakra-ui-vue/blob/develop/packages/chakra-ui-core/src/CStack/CStack.js#L51 and https://github.com/chakra-ui/chakra-ui-vue/blob/develop/packages/chakra-ui-core/src/CStack/CStack.js#L54 respectively.

To Reproduce
Steps to reproduce the behavior:

  1. Generate Vue project using the latest version of chakra-ui/vue
  2. Use above example
  3. Cannot render due to error.

Stacktrace:

TypeError: this.direction.startsWith is not a function
 _isInline CStack.js:1

Expected behavior
It should handle the case where the direction prop is an array for each breakpoint, not only when direction is a string.

Desktop:

  • OS: Fedora 33
  • Browser: Firefox Dev 86.0b6
  • Version: "@chakra-ui/nuxt": "^0.2.4",

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /