svelte-material-ui icon indicating copy to clipboard operation
svelte-material-ui copied to clipboard

`name` Attribute Getting Set On Label Rather Than Input

Open jwsinner opened this issue 2 years ago • 0 comments

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:

  1. Create basic TextField component
  2. Assign name attribute
  3. Run project
  4. 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 SMUI TextField Code SMUI TextField Display SMUI TextField Inspect

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.

jwsinner avatar May 31 '22 16:05 jwsinner