Skip to content

Toolbar Doesn't Appear When Mouseup Event Occurs Outside Editor – Proposal to Use Document-Level Event Listeners #1417

@tpostolyuk

Description

@tpostolyuk

Is your feature request related to a problem? Please describe.
When selecting text and dragging the mouse outside the editor area, the formatting toolbar does not appear. This happens because event listeners are currently attached to pmView.dom, which does not capture mouseup events occurring outside the editor.

Describe the solution you'd like
Instead of attaching event listeners to pmView.dom, they should be bound to document. This would ensure that mouseup events are captured regardless of whether the cursor is inside or outside the editor, making the toolbar appear as expected.

Describe alternatives you've considered
Keeping the event listeners on pmView.dom but adding a global event listener specifically for mouseup outside the editor.
Providing an option to toggle between pmView.dom and document for event handling.

Additional context
A place where the issue is:
Image

Bonus
[ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions