Fix apply callback running twice in diagnostic actions #13

Closed
sergeichestakov wants to merge 1 commit from double-apply into main
sergeichestakov commented 2023-02-15 07:14:25 +01:00 (Migrated from github.com)

It looks like the apply handlers for lint diagnostic actions are getting run twice because it's being executed as part of the onclick and onmousedown events, which does not seem to be intentional (but please correct me if I'm wrong).

See repro here: https://replit.com/@SergeiChestakov/cm-lint-apply

And demo below:

double-lint-action

It looks like the apply handlers for lint diagnostic actions are getting run twice because it's being executed as part of the `onclick` _and_ `onmousedown` events, which does not seem to be intentional (but please correct me if I'm wrong). See repro here: https://replit.com/@SergeiChestakov/cm-lint-apply And demo below: ![double-lint-action](https://user-images.githubusercontent.com/24947334/218947228-fdfee3eb-6268-4208-ae55-9b1e3b450f84.gif)
marijnh commented 2023-02-15 08:11:48 +01:00 (Migrated from github.com)

We do want that handler to avoid the click moving focus. Attached patch fixes this with a kludgey extra boolean variable instead.

We do want that handler to avoid the click moving focus. Attached patch fixes this with a kludgey extra boolean variable instead.
sergeichestakov commented 2023-02-15 18:27:49 +01:00 (Migrated from github.com)

ahh great that's the workaround we used internally haha thanks! looking forward to this being published

ahh great that's the workaround we used internally haha thanks! looking forward to this being published
marijnh commented 2023-02-15 19:17:00 +01:00 (Migrated from github.com)

I've tagged 6.1.1

I've tagged 6.1.1

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!13
No description provided.