Access Event in Diagnostic apply fn #14

Closed
bradymadden97 wants to merge 3 commits from main into main
bradymadden97 commented 2023-04-26 22:01:37 +02:00 (Migrated from github.com)

I need to stop propagation on the mousedown event fired by clicking on a diagnostic action. Ideally I wouldn't need to override the entire component with renderMessage to do so, I could just have access to the mousedown event here.

I need to stop propagation on the `mousedown` event fired by clicking on a diagnostic action. Ideally I wouldn't need to override the entire component with `renderMessage` to do so, I could just have access to the `mousedown` event here.
marijnh commented 2023-04-26 22:11:11 +02:00 (Migrated from github.com)

I'd recommend you have a plugin add an event handler to the outer editor element and check whether the event needs to be stopped by looking at its target from there. Passing events to these seems like a conceptual mismatch and limits the situations in which we can potentially use them.

I'd recommend you have a plugin add an event handler to the outer editor element and check whether the event needs to be stopped by looking at its target from there. Passing events to these seems like a conceptual mismatch and limits the situations in which we can potentially use them.
bradymadden97 commented 2023-04-26 22:47:06 +02:00 (Migrated from github.com)

@marijnh those events don't propagate to the view it seems. Perhaps because they're in a tooltip? Added an EventHandler in a tooltip and never saw the mousedown or click event fire.

@marijnh those events don't propagate to the view it seems. Perhaps because they're in a tooltip? Added an EventHandler in a tooltip and never saw the mousedown or click event fire.
marijnh commented 2023-04-27 07:28:45 +02:00 (Migrated from github.com)

They don't propagate through the content, but the outer view.dom element should get them (assuming you aren't using the parent option to tooltips).

They don't propagate through the content, but the outer `view.dom` element should get them (assuming you aren't using the [`parent`](https://codemirror.net/docs/ref/#view.tooltips^config.parent) option to `tooltips`).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lint!14
No description provided.