Skip to content

Conversation

@fsw
Copy link

@fsw fsw commented Nov 24, 2025

According to MDN mouse* and drag* events bubble up to Document and Window:

https://developer.mozilla.org/en-US/docs/Web/API/Window#bubbled_events
https://developer.mozilla.org/en-US/docs/Web/API/Document#bubbled_events

Also code like this was working with dart:html:

document.onMouseMove.listen(handler);
document.onDragEnd.listen(handler);

I am not sure about the touch* events. MDN does not list those events for Document and Window but on the other hand they do bubble (at least in Firefox 145.0.* and Chrome 142.0.*). Also onTouchMove was already added in WindowEventGetters and those events were also working with dart:html. So maybe those should be added but to WindowCustomEvents and DocumentCustomEvents extensions instead?


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

@kevmoo
Copy link
Member

kevmoo commented Nov 24, 2025

Thoughts @srujzs

At a minimum @fsw we'll want a changelog entry here!

Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay! LGTM % my comments.

Stream<TouchEvent> get onTouchEnd =>
EventStreamProviders.touchEndEvent.forTarget(this);

Stream<TouchEvent> get onTouchEnter =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this and onTouchLeave didn't exist on Window before, so perhaps remove?

Stream<TouchEvent> get onTouchEnd =>
EventStreamProviders.touchEndEvent.forTarget(this);

Stream<TouchEvent> get onTouchEnter =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and onTouchLeave also didn't exist on Document before, perhaps remove?

@srujzs
Copy link
Contributor

srujzs commented Dec 8, 2025

I am not sure about the touch* events. MDN does not list those events for Document and Window but on the other hand they do bubble (at least in Firefox 145.0.* and Chrome 142.0.*). Also onTouchMove was already added in WindowEventGetters and those events were also working with dart:html. So maybe those should be added but to WindowCustomEvents and DocumentCustomEvents extensions instead?

Yeah, some of the touch events don't really exist afaict (e.g. touchleave). It's possible they were removed at some point from the spec, but for parity with dart:html, keeping those is reasonable. WindowCustomEvents was really meant for the events that required some additional, custom checks. That doesn't apply here, so putting the added events in WindowEventGetters and DocumentEventGetters is fine.

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

Successfully merging this pull request may close these issues.

3 participants