A console error message appears in some cases when a sl-input receives an autofill value.
To Reproduce
Create a form with at least one sl-input and sl-select element.
Upload the HTML document on a web server. Autofill doesn't work on local files.
Open the page in Microsoft Edge, fill it and submit it. After submission, Edge will remember the values you entered.
Refresh the page, fill the form again, but now use the autofill to enter the same value in the sl-input as earlier.
You will get a console error:
TypeError: Cannot read properties of undefined (reading 'length')
at SlSelect.handleDocumentKeyDown (chunk.IMHWGJEP.js:178:21)
at SlSelect.handleComboboxKeyDown (chunk.IMHWGJEP.js:282:10)
at EventPart.handleEvent (lit-html.ts:2068:29)
It appears that the autofill triggers sl-keydown, but Edge sends undefined instead of a valid keydown event.
It also appears to randomly occur or not occur, depending on the web server. The demo page I published on GitHub Pages doesn't trigger it. If I host the same HTML document on our intranet server, running IIS, then it's triggered. I believe this is due to how Autofill works.
Describe the bug
A console error message appears in some cases when a
sl-input
receives an autofill value.To Reproduce
sl-input
andsl-select
element.sl-input
as earlier.It appears that the autofill triggers
sl-keydown
, but Edge sendsundefined
instead of a valid keydown event.It also appears to randomly occur or not occur, depending on the web server. The demo page I published on GitHub Pages doesn't trigger it. If I host the same HTML document on our intranet server, running IIS, then it's triggered. I believe this is due to how Autofill works.
Demo
https://tomcatmwi.github.io/sl-select-bug-demo
Screenshots
https://ibb.co/fC0NR62
Browser / OS
Additional information
Here is a simple reproduction: