Closed evenmark closed 7 years ago
Thanks for bug report, I will check it when will be at my laptop.
Ok, so according to spec input with type="email" does not support selection and Chrome on all platforms will throw an error.
setSelectionRange() puts cursor at the end of invalid input after focusing it, however, as I can see, Chrome already does it, so I will just add a small case there.
This will be available with next release (1-2 days), I'm gonna finish Dropdown and Autocomplete refactoring and docs first.
If you have any ideas or feedback about your experience using BunnyJS, please let me know, thanks!
I have
<input type="email" name="whatever" required maxlength="50" />
when validating, and input contains invalid value Chrome 54 macOS gives:
Validation.js:658 Uncaught (in promise) DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('email') does not support selection.
Validation.js line #658
input.setSelectionRange(input.value.length, input.value.length);