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

Prosemirror does not handle DOM focus events #777

Closed
2 of 4 tasks
Gozala opened this issue Mar 29, 2018 · 2 comments
Closed
2 of 4 tasks

Prosemirror does not handle DOM focus events #777

Gozala opened this issue Mar 29, 2018 · 2 comments

Comments

@Gozala
Copy link

Gozala commented Mar 29, 2018

Issue details

If focus event is dispatched on one of nodes with-in the editor prosemirror does not handle it. For example if there is a tabindex attribute present on the paragraph or heading nodes using Tab / Shift-Tab key combination dispatches focus event on a corresponding node (which does not bubble up if container is focused) so prose-mirror does not handle it in any way.

It is also won't make it into handleDOMEvents for the same reason.

Steps to reproduce

Here is an example that adds tabindex=0 attribute to the paragraph and heading nodes
https://glitch.com/edit/#!/join/a592d66e-470c-4c5d-a7d9-9c351aae426d

If you press Tab / Tab-Shift you'll see an outline appearing on o corresponding node but selection will remain in it's original location.

I would expect Tab / Tab-Shift to update selection so that content of the corresponding paragraph / heading is selected.

ProseMirror version

"prosemirror-view": "1.2.0"

Affected platforms

  • Chrome
  • Firefox
  • Internet Explorer
  • Other
@marijnh
Copy link
Member

marijnh commented Mar 29, 2018

ProseMirror's focus handling concerns focus of its top-level editable node. Focus on children of that is intentionally not handled—and setting a tabindex on a paragraph isn't something the system supports.

@marijnh
Copy link
Member

marijnh commented Mar 18, 2020

Closing as out of scope—the project assumes a single focusable editor, and I'm not even sure how a different approach would work.

@marijnh marijnh closed this as completed Mar 18, 2020
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