-
Notifications
You must be signed in to change notification settings - Fork 44
Add mouse*, drag* and touch* events to Window and Document events stream helper extensions #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
srujzs
left a comment
There was a problem hiding this 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 => |
There was a problem hiding this comment.
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 => |
There was a problem hiding this comment.
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?
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. |
According to MDN
mouse*anddrag*events bubble up toDocumentandWindow: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:I am not sure about the
touch*events. MDN does not list those events forDocumentandWindowbut on the other hand they do bubble (at least in Firefox 145.0.* and Chrome 142.0.*). AlsoonTouchMovewas already added inWindowEventGettersand those events were also working withdart:html. So maybe those should be added but toWindowCustomEventsandDocumentCustomEventsextensions instead?