Tram-One/tram-one

Range input causes error trying to re-attach focus

Closed this issue · 2 comments

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.

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.

This was found as a side effect of solving #185