Tram-One / tram-one

🚋 Legacy View Framework For Vanilla Javascript
http://tram-one.io/
MIT License
36 stars 8 forks source link

Range input causes error trying to re-attach focus #184

Closed JRJurman closed 2 years ago

JRJurman commented 2 years ago

Summary

When using an input with type range, trying to re-attach focus (and specifically set selectionStart / selectionEnd / selectionDirection) causes an error.

Potential Solution

We should wrap this logic in a try-catch. Usually I would suggest to do a more complex check here, but this happens when the element already has a setSelectionRange, so there isn't much else to check as far as I can tell.

JRJurman commented 2 years ago

I was half-way through writing this before getting distracted - I am working on this now and plan on having a PR out (hopefully) soon.

JRJurman commented 2 years ago

This was found as a side effect of solving #185