svelte-material-ui
svelte-material-ui copied to clipboard
`name` Attribute Getting Set On Label Rather Than Input
Describe the bug
When adding a "name" attribute to a TextField
the name gets set on the label but not the input itself.
To Reproduce Steps to reproduce the behavior:
- Create basic TextField component
- Assign
name
attribute - Run project
- Inspect text field to see
name
on label, but not input
Expected behavior Name attribute should be assigned to input when added to TextField
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Browser : Firefox, Chrome
- Version Most Recent as of posting
Work Around
Currently, the way to get around this is to create a basic hidden input with the name you want and binding the value to that of the TextField
. Any type of form input should allow for the name attribute to take advantage of SvelteKit's endpoints and its ability to work even with javascript disabled.