-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] - DatePicker styling classes: input and inputWrapper #2895
Comments
2nd this issue. Just ran into it. No way to access the input via the ClassNames prop. |
The label styles is not working too, only received: |
Up on this. label, description, input, inputWrapper classes are not properly passed to the slots, so just ignored |
I solved it like this: <div className='bg-background-date'> .bg-background-date [data-slot='base'] [data-slot='input-wrapper'] { /* bonus for select and autocomplete */ .bg-background-autocomplete [data-slot='main-wrapper'] [data-slot='input-wrapper'] { .bg-background-select [data-slot='base'] [data-slot='mainWrapper'] [data-slot='trigger'] { |
Any updates on this issue? I've done some research and discovered that although the data slots are commented in the NextUI npm package, they aren't actually implemented or usable. Comment in "use-date-picker.d.ts"
Code in "date-picker.d.ts"
Concluding: the data slots below do not work
|
I've encountered the same problem. In my case I needed to set some properties to the input wrapper. If you're using tailwind you may avoid this with its selectors. Still it's a temporary solution, so I'm looking forward to get it fixed |
|
<DatePicker className="my-4 [&>[data-slot='label']]:flex" |
Não tenho certeza se vai ajudar, porém da forma que eu fiz resolveu alguns problemas. Utilizando o método que o pessoal inseriu acima
obs: cn() -> tailwind-merge + clsx Minha ideia era mudar a cor dos caracteres da data "dd/mm/aaaa -- HH/MM", porém, utilizando apenas o classNames={{}} eu não conseguia. Então pelo DevTools busquei os atributos que correspondiam a div e a classe tailwind do elemento que seria alterada e no final deu certo.
mais uma obs: |
NextUI Version
2.3.6
Describe the bug
I'm facing difficulties while trying to style the DatePicker component. I noticed that the input and inputWrapper classes are not properly passing props to the component, which is hindering proper styling. This occurs both when attempting to style directly on the component and through extendedVariants.
I've tried several approaches to style this component, but the only property I managed to use was "base". However, when attempting to style, it ends up affecting the entire container of the component, including the label and the input.
screenshot:
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Expected behavior
I expected that when applying styles to the DatePicker component using the input and inputWrapper classes, the component would properly receive the props and apply the styling accordingly. Specifically, I anticipated that styling would be applied to the input field and its wrapper without affecting other elements within the component, such as the label.
Gravando.2024-04-27.111039.mp4
Screenshots or Videos
with inputWrapper prop
with input prop
with base prop
Operating System Version
Browser
Edge
The text was updated successfully, but these errors were encountered: