Skip to content
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

Open
rafagouveia opened this issue Apr 27, 2024 · 5 comments
Open

[BUG] - DatePicker styling classes: input and inputWrapper #2895

rafagouveia opened this issue Apr 27, 2024 · 5 comments

Comments

@rafagouveia
Copy link

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

  1. Use the next ui version 2.3.6 in your project.
  2. Implement the DatePicker component.
  3. Attempt to style the DatePicker component using the input and inputWrapper classes.
  4. Notice that the input and inputWrapper classes are not properly passing props to the component, resulting in improper styling.
  5. Try styling the component directly and also through extendedVariants.
  6. Observe that despite trying various approaches, only the "base" property is successfully applied for styling.
  7. Notice that styling with the "base" property affects the entire container of the component, including the label and the input.

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

image

with input prop
image

with base prop
image

Operating System Version

  • Windows 11

Browser

Edge

Copy link

linear bot commented Apr 27, 2024

@christo9090
Copy link

2nd this issue. Just ran into it. No way to access the input via the ClassNames prop.

@eichtici-sys
Copy link

eichtici-sys commented May 7, 2024

The label styles is not working too, only received:
<"base" | "selectorButton" | "selectorIcon" | "popoverContent" | "calendar" | "calendarContent" | "timeInputLabel" | "timeInput">

@tusmenko
Copy link

tusmenko commented May 8, 2024

Up on this. label, description, input, inputWrapper classes are not properly passed to the slots, so just ignored

@whitetown
Copy link

whitetown commented May 13, 2024

I solved it like this:

<div className='bg-background-date'>
<DateInput name='min_date' />
</div>

.bg-background-date [data-slot='base'] [data-slot='input-wrapper'] {
@apply bg-background;
}

/* bonus for select and autocomplete */

.bg-background-autocomplete [data-slot='main-wrapper'] [data-slot='input-wrapper'] {
@apply bg-background;
}

.bg-background-select [data-slot='base'] [data-slot='mainWrapper'] [data-slot='trigger'] {
@apply bg-background;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants