flutter
flutter copied to clipboard
[web] Fix other places that use clientX/Y rather than offsetX/Y (text input?, semantics helper?)
So far, these are the places that I've found that aren't using the correct coordinates for the events they're handling (they'd only work in full-screen mode):
pointer_binding.dart
In the pointer_binding, it seems that 'pointerup' events are incorrectly attached to domWindow. Those should be attached to the glassPane. See:
- https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/pointer_binding.dart#L690
(There's probably a need to synthesize a 'pointercancel' event if there's a pointerup detected OUTSIDE of the glassPane too!)
text_field.dart
See:
- https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/semantics/text_field.dart#L294-L299
(and below)
semantics_helper.dart
See:
- https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/semantics/semantics_helper.dart#L331-L340
(Using client coordinates rather than offset. Note that for touch events, there's no "offset" and it needs to be computed from the clientBoundingRect of the event target!)