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

contenteditable test gives false negative in Firefox 3.x #570

Closed
timdown opened this issue Apr 30, 2012 · 3 comments
Closed

contenteditable test gives false negative in Firefox 3.x #570

timdown opened this issue Apr 30, 2012 · 3 comments

Comments

@timdown
Copy link

timdown commented Apr 30, 2012

The contenteditable test gives false negatives in some browsers because isContentEditable is not implemented in some browsers that do support contenteditable, such as Firefox 3.x.

Instead of

Modernizr.addTest('contenteditable', 'isContentEditable' in document.documentElement);

... I would suggest:

Modernizr.addTest('contenteditable', 'contentEditable' in document.documentElement);

See

https://developer.mozilla.org/en/DOM/Element.isContentEditable
https://developer.mozilla.org/en/DOM/element.contentEditable

@paulirish
Copy link
Member

That sounds good. Can you doublecheck your version produces correct results in all desktop browsers?

From what i hear, it's unreliable on mobile. See html5test.com's source for details on that one.

@timdown
Copy link
Author

timdown commented May 3, 2012

It's fine in desktop browsers I've tried (IE 6+, Firefox 2+, Opera 11, Chrome, Safari 4+) and I'm pretty sure about older Safari and Opera, although I don't have them to hand. Mobile I don't know, I only have iOS 5 devices (fine in those), although I recall that prior to iOS 5, you could set contenteditable on an element and it would claim to be contenteditable without actually allowing editing, as noted in the Undetectables page.

Not sure where to find details in http://html5test.com/ about contenteditable in mobile: I can see that it's testing for contentEditable and isContentEditable but if there's more detail then I missed it.

@benvinegar
Copy link

Re: mobile, Android 2.3 and below don't properly report isContentEditable either: http://alfonsoml.blogspot.com/2010/07/does-android-22-support-contenteditable.html

Currently hitting this issue right now.

patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
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