Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key-sequence throws error with <input type="email"> on Chrome #27

Open
omahlama opened this issue Mar 19, 2015 · 2 comments
Open

Key-sequence throws error with <input type="email"> on Chrome #27

omahlama opened this issue Mar 19, 2015 · 2 comments

Comments

@omahlama
Copy link

Test case (forked from demo):

http://jsfiddle.net/omahlama/5xLe3svo/1/

This throws an exception on chrome, the error is:

Failed to read the 'selectionStart' property from 'HTMLInputElement': 
The input element's type ('email') does not support selection.

Related stackoverflow question with the problem explained:

http://stackoverflow.com/questions/21177489/selectionstart-selectionend-on-input-type-number-no-longer-allowed-in-chrome

@j-ulrich
Copy link
Owner

Hm... I guess the only way to solve this issue is to either fix it in bililiteRange or replace bililiteRange.

Replacing bililiteRange gets more and more attractive. Rangy seems to be good candidate.

No! I was wrong! I could of course check the type of the element in in the key-sequence plugin and then prevent the creation of the range object.
But then the question is: how should the simulation of the special sequences (like {leftarrow}, {backspace}, {selectall}, etc.) behave if we don't know where the cursor is?
Should they just be ignored (i.e. no-ops)?

@omahlama
Copy link
Author

omahlama commented Apr 2, 2015

I would guess that no-ops with browser detection would be the best option - it would be completely backwards compatible, as no-one was able to do those things with email inputs on chrome anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants