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

Selected text causes TinyMCE menu and selection to disappear #27

Open
bjones1 opened this issue May 22, 2024 · 2 comments
Open

Selected text causes TinyMCE menu and selection to disappear #27

bjones1 opened this issue May 22, 2024 · 2 comments

Comments

@bjones1
Copy link
Owner

bjones1 commented May 22, 2024

If a selection is made in the TinyMCE editor inside Codemirror, then the user clicks on either the Format menu or the formatting drop-down, then the TinyMCE menu bar and the selection disappear.

@bjones1
Copy link
Owner Author

bjones1 commented Jul 14, 2024

Follow-up debug: v. 6.0.0 of the Codemirror view works, while v6.0.1 doesn't. Investigation shows that this commit causes the failure. Backing out this changes fixes the behavior. In the current Codemirror view we have:

        let selectionNotFocus = !focused &&
            hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));

Adding the following line fixes the bug:

        selectionNotFocus = this.view.state.facet(editable) ? focused : hasSelection(this.dom, this.view.observer.selectionRange)

I don't yet understand why, or how to investigate further.

@bjones1
Copy link
Owner Author

bjones1 commented Aug 20, 2024

The procedure to make this edit:

  1. In the client/ directory, run npm update.
  2. Edit client/node_modules/@codemirror/view/dist/index.js per the directions above. Important: do not edit index.cjs (which isn't used in the build).
  3. In the client directory, run npm run build.
  4. Stop the server then re-run it.

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

1 participant