-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Incompatibility between VueUse useTextDirection and the dir prop of ConfigProvider #875
Labels
bug
Something isn't working
Comments
Thanks for the issue @dwightjack ! In this case I think we need to update the docs, to have clearer example of using const textDirection = useTextDirection()
const dir = computed(() => textDirection.value === 'rtl' ? 'rtl' : 'ltr'
// doing so to make sure the `dir` is only returning the types that radix-vue supports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-jbusm6?file=src%2FApp.vue
Steps to reproduce
npx vue-tsc
.Type 'UseTextDirectionValue' is not assignable to type 'Direction | undefined'.
Describe the bug
In VueUse
useTextDirection
has a type of:While, in our case, the
dir
prop ofConfigProvider
has the following type:How to fix
By updating the type on our side including the
auto
value, the error disappears, but I am not sure of which kind of changes are required to accommodate theauto
value. I can submit a PR if you think we should fix this, but I might need some guidance on the best way to approach the problem (could it be just to discardauto
in the provider? Implement some new behavior on the components depending on directionality?)Expected behavior
We should not have that TypeScript type error.
Context & Screenshots (if applicable)
No response
The text was updated successfully, but these errors were encountered: