Theming prop `size` conflicts with input prop `size`
See original GitHub issueDescription
When I want to set the DOM attribute size={3}
of an <input>
element, I am unable to do it with <Input>
since size
is interpreted as a theme prop, and not a native attribute.
Link to Reproduction
https://codesandbox.io/s/jovial-mendeleev-upylk?file=/src/index.js
Steps to reproduce
See above CodeSandbox
Chakra UI Version
1.6.3
Browser
No response
Operating System
- macOS
- Windows
- Linux
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Advanced Usage - styled-components
Theming. styled-components has full theming support by exporting a <ThemeProvider> wrapper component. This component provides a theme to all React ...
Read more ><input>: The Input (Form Input) element - HTML
Valid for email , password , tel , url , and text , the size attribute specifies how much of the input is...
Read more >Global Styling with Material-UI Theme Overrides and Props
Learn how to use global CSS overrides and default props in a theme to customize all instances of a Material-UI component in a...
Read more >How to Create Smaller `Input` in React-Bootstrap | Pluralsight
Another possible value for the size prop is lg , which will increase the size of the field. Using Custom CSS. The traditional...
Read more >styled() - MUI System
overridesResolver ((props: object, styles: Record<string, styles>) => styles [optional]): Function that returns styles based on the props and the theme.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, sounds like a good solution!
Hi David, Thanks for raising this issue.
I think this prop name clash is comparable to the attributes
width
andheight
for the Image component where we addedhtmlWidth
andhtmlHeight
as props.My suggestion would be to add a new prop to the Input component called
htmlSize
and pass it to the input DOM element.Would that solve your issue?