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

Extra <div> wrapper around DateInput DOM prevents setting className, styles on outermost element #2421

Open
amcclain opened this issue May 4, 2021 · 3 comments

Comments

@amcclain
Copy link
Member

amcclain commented May 4, 2021

The desktop DateInput component renders with an outer <div> element that does not take the className or style props passed to the component -

Often classNames or styles are used for layout concerns like padding or margins, which can't be controlled here. Specifically, I might wish to use a class or style to override the padding applied to a dateInput within a toolbar - that's something that happens at the outermost layer.

I would vote for applying at least className to the outer div. If needed, could support inputClassName, but not sure we really need that.

@amcclain
Copy link
Member Author

See example of nested DOM elements:

  • 1 anonymous (no class specific) outer div
  • 2x BP popover spans
  • 1 anon div (again)
  • 1 div with all of the expected classnames (including duped up xh-input, FWIW)
  • 1 BP input-group div
  • the actual text input + BP input-actions div for buttons

Screen Shot 2021-06-30 at 6 51 11 AM

@amcclain amcclain modified the milestones: v43, Medium Term Sep 1, 2021
@amcclain amcclain mentioned this issue May 13, 2022
6 tasks
@amcclain amcclain modified the milestones: Medium Term, v56 Feb 15, 2023
@amcclain
Copy link
Member Author

Reviving this as I just ran into it again. How about having DateInput take a dedicated wrapperClassName prop?

@amcclain amcclain removed this from the v56 milestone May 8, 2023
@amcclain
Copy link
Member Author

We should confirm if this is still an issue with latest BP library

@amcclain amcclain added the ready label Jun 13, 2024
@amcclain amcclain changed the title DateInput <div> wrapper prevents setting className, styles on outermost element Extra <div> wrapper around DateInput DOM prevents setting className, styles on outermost element Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants