Skip to content

Resume propagation of events#2873

Merged
daxpedda merged 1 commit into
rust-windowing:masterfrom
daxpedda:web-event-propagation
Jun 11, 2023
Merged

Resume propagation of events#2873
daxpedda merged 1 commit into
rust-windowing:masterfrom
daxpedda:web-event-propagation

Conversation

@daxpedda
Copy link
Copy Markdown
Member

@daxpedda daxpedda commented Jun 11, 2023

I'm not entirely sure why stopPropagation() is being used, maybe because preventDefault() wasn't used back then. In any case, I don't think we want to prevent parents to receive events if they want to.

The call to cancelBubble doesn't do anything, it's a getter.

EDIT: See #2873 (comment), I decided to keep stopPropagation() for now.

@daxpedda daxpedda added the DS - web Affects the Web backend (WebAssembly/WASM) label Jun 11, 2023
@daxpedda daxpedda force-pushed the web-event-propagation branch from a09d4c9 to 6de189f Compare June 11, 2023 20:50
@daxpedda daxpedda force-pushed the web-event-propagation branch from 6de189f to 4b528f9 Compare June 11, 2023 22:36
@daxpedda
Copy link
Copy Markdown
Member Author

It's also blocking DeviceEvents from working correctly, you stop receiving them when the events are triggered in the canvas. See #2871.

I actually had to fix it in a different way. The web backend can't send events from multiple handlers at the same time, it has to restart the event loop every time. So I'm trying as much as possible to coalesce as many events as possible.

So for now stopPropagation() is actually helping #2871, otherwise I would have to check if the mouse is over the canvas or not (which shouldn't be too hard). We can eventually remove it when somebody actually complains.

@daxpedda daxpedda merged commit fc046ad into rust-windowing:master Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - web Affects the Web backend (WebAssembly/WASM)

Development

Successfully merging this pull request may close these issues.

1 participant