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

NS_ERROR_FAILURE in Firefox when focusing editor #141

Closed
caolan opened this issue Dec 13, 2019 · 3 comments
Closed

NS_ERROR_FAILURE in Firefox when focusing editor #141

caolan opened this issue Dec 13, 2019 · 3 comments

Comments

@caolan
Copy link

caolan commented Dec 13, 2019

Ok, this is a strange one and probably points to a bug in Firefox itself. Since I've only been able to recreate this when using codemirror.next I'm raising it here so you can decide whether it should be raised upstream or not.

To see the error, replace demo.ts with the following:

import { EditorState } from "../state"
import { EditorView } from "../view";

const state = EditorState.create();
const view = new EditorView({ state });

document.querySelector("#editor")!.appendChild(view.dom);

// This is what causes the NS_ERROR_FAILURE to happen later
const input = document.createElement('input');
document.body.appendChild(input);
input.focus();
input.remove();

Then, run the demo using npm run dev and focus the codemirror editor with the mouse cursor. You should see NS_ERROR_FAILURE followed by some other "Calls to EditorView.update are not allowed while an update is in progress" errors from codemirror.

This only occurs in Firefox, not in Chrome (haven't tested elsewhere). I'm using 71.0 (64-bit) on Linux. I recall this happening on an older version too (before I narrowed down this test case).

@caolan
Copy link
Author

caolan commented Dec 14, 2019

For the record, I have tried replacing the codemirror editor with a plain contenteditable element and with a text input to see if the focus charge to one of those causes the error. Neither does.

There is something particular about codemirror that triggers this.

@marijnh
Copy link
Member

marijnh commented Jan 2, 2020

Can you still reproduce this with the current codebase? (It's not happening on my side.)

@marijnh marijnh closed this as completed Jan 2, 2020
@marijnh marijnh reopened this Jan 2, 2020
@caolan
Copy link
Author

caolan commented Jan 2, 2020

I updated codemirror and can confirm it cannot be reproduced with the latest codebase.

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