-
Notifications
You must be signed in to change notification settings - Fork 373
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]: NumberField without Increment and Decrement #613
Comments
Hello There ! |
Adding There are also other temporary options such as using |
Oh, I understand, how about adding a boolean prop to the input, to conditionally change the padding based on the presense of the Inc/Dec buttons? |
As stated above, a boolean prop could solve the problem, but developer experience would be lacking. It would not be much different from the temporary solution offered in the bug description. |
I think we could use CSS feature like |
I tried looking into @Saeid-Za , @sadeghbarati , what do you think about a solution similar to the one offered by radix-vue?
This would eliminate complex peer checking, but allow to use the component in different configurations:
|
Change the NumberField, so it could be used in different configuration without extra effort from the developer.
That are not issue of shadcn, just add class |
While I agree, it's easy to fix, it's also a question of developer experience. Using a Number Field without decrement and increment is quite a common use case. Should developers modify the component themselves for this obvious use case, or should shadcn-vue provide a working solution out-of-the-box? At the very least, there should be a class prop for the NumberFieldInput component and an example in the documentation so developers don't have to think about it. |
Reproduction
https://codesandbox.io/p/devbox/shadcn-vue-numberfield-padding-xnwmrm
Describe the bug
When removing
NumberFieldDecrement
andNumberFieldIncrement
aroundNumberFieldInput
, the input has large padding on both sides.My temporary fix was to add
px-1
class toNumberFieldInput
like so:<NumberFieldInput class="px-1" />
The
NumberFieldInput
component must have a class prop to override the padding:System Info
Contributes
The text was updated successfully, but these errors were encountered: