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

Firefox Issue TypeError: b.nativeSelection is null #32

Closed
Themonkey180 opened this issue Apr 10, 2014 · 5 comments
Closed

Firefox Issue TypeError: b.nativeSelection is null #32

Themonkey180 opened this issue Apr 10, 2014 · 5 comments

Comments

@Themonkey180
Copy link

This came up recently when the page is loaded. It gives me this error from firebug:

TypeError: b.nativeSelection is null
wysiht...2581355 (line 299)

After the page loads it does not show anything where the text area is supposed to be. An help would be nice.

@brunobg
Copy link

brunobg commented Apr 22, 2014

I've had that before. It happens only in firefox and this fixes the issue: tiff/wysihtml5#371

@Themonkey180
Copy link
Author

Thank you

@rayrigam
Copy link

What exactly is the fix? This seems like a bug that should still be fixed, and thus the issue should be re-opened. Regarding the referenced comments in xing#371, in many use cases, the textarea is hidden when the page loads (for example when a form is hidden with display:none, and is only shown after the user clicks a button, which is my use case). Also, the proposed fix in the rangy-core.js code (which has not been officially implemented in that library) has not yet been implemented in wysihtml5x either, as done here.

Moreover, the previous proposed fix eliminates the TypeError: b.nativeSelection is null; however, it does not eliminate a second error that occurs when the textarea is hidden during page load (in Firefox): NS_ERROR_FAILURE (on line: 12446): that.doc.execCommand("enableObjectResizing", false, "false");.

I was using wysihtml5 version 0.3.0 and there was no error related to this. The error was introduced in version 0.4.0 and still exists in the current versions.

@rayrigam
Copy link

@pulges I think this should be re-opened, don't you think? Even with the above mentioned fix, I still get an NS_ERROR_FAILURE when the form is hidden at page load, as mentioned above... This seems pretty critical...

@pulges pulges reopened this Jun 27, 2014
@jebw
Copy link

jebw commented Jun 27, 2014

I'm also hitting this, in a form that's brought in via AJAX, then initialised. Only seems to affect Firefox

jebw pushed a commit to jebw/wysihtml5 that referenced this issue Jun 27, 2014
Note: only applied to dist file, quick fix not intended to go upstream
patch from Voog#32
jebw pushed a commit to jebw/wysihtml5 that referenced this issue Jun 27, 2014
pulges pushed a commit that referenced this issue Aug 6, 2014
… from not displayed element on initiation.
@pulges pulges closed this as completed in 124c7e7 Aug 6, 2014
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

5 participants