-
Notifications
You must be signed in to change notification settings - Fork 137
feat: CStack: make direction prop responsive #390
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:
- Generate Vue project using the latest version of chakra-ui/vue
- Use above example
- 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",