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

hasEvent() dosn't detect "textInput" event #333

Closed
fjakobs opened this issue Aug 3, 2011 · 5 comments
Closed

hasEvent() dosn't detect "textInput" event #333

fjakobs opened this issue Aug 3, 2011 · 5 comments

Comments

@fjakobs
Copy link

fjakobs commented Aug 3, 2011

Modernizr.hasEvent("textInput") returns false in the latest Chrome (14.0.835.8 dev) although this event is supported.

@paulirish
Copy link
Member

did it work in previous versions? event detection is hard. :(

@fjakobs
Copy link
Author

fjakobs commented Aug 3, 2011

I have no idea. I just tried it today.

Also

document.implementation.hasFeature('Events.textInput', '')

returns false even though the event is supported.

@kangax
Copy link

kangax commented Aug 3, 2011

hasFeature has always been notoriously unreliable as far as I know, so I wouldn't even go there... :)

@kangax
Copy link

kangax commented Aug 3, 2011

From what I can see, "textInput" is one of those synthetic events which has no corresponding content attribute (so you can't just <input_element>.onTextInput = function(){ ... }, and you can't check for presence of that property/method). It also doesn't fire when text is input by setting element's "value" attribute (at least in Chrome).

This is bad.

Two (also bad) options I see are:

  1. Assume that textInput is supported when global TextEvent object is present. This is unreliable, but it could work.

  2. Try to insert element into a document, attach textInput event handler, generate event on an element that would cause element value to change, check if event fired.

@paulirish
Copy link
Member

Looks like textinput is in flux. http://lists.w3.org/Archives/Public/www-dom/2010OctDec/0098.html

Dunno how we can handle this.

fwiw, the spec: http://www.w3.org/TR/DOM-Level-3-Events/#event-type-textinput

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

3 participants