refactor: Migrate to PointerEvents (#6598)

* refactor: Remove checks for PointerEvent support.

* refactor: Deprecate and remove calls to splitEventByTouches.

* refactor: Deprecate and remove calls to setClientFromTouch().

* refactor: Use PointerEvent in place of Event/MouseEvent/TouchEvent/PseudoEvent.

* refactor: Update references to mouse/touch events in code and documentation to reference pointer events.

* refactor: Merge Gesture and TouchGesture

* chore: clang-format changed files

* refactor: Bind and expect PointerEvents instead of MouseEvents.

* refactor: Rename TouchGesture to Gesture.

* fix: Fix test failures.

* chore: clang-format changed files.

* fix: Fix errant _ from merging

* refactor: Clean up dead code in browser_events.ts.

* chore: Update version in deprecation notices to reflect release schedule

* fix: Fixed a bug that caused the browser context menu to not be suppressed in Chrome.

* fix: Re-export Gesture as TouchGesture for backwards compatibility.

* refactor: Deprecate and remove uses of opt_noPreventDefault.

* chore: Fix error message in gesture.ts.

* chore: Removed obsolete todo.
This commit is contained in:
Aaron Dodson
2022-12-05 11:27:52 -08:00
committed by GitHub
parent 9741cd2530
commit 90cb965e7c
30 changed files with 545 additions and 806 deletions

View File

@@ -170,7 +170,8 @@ export class FlyoutButton {
// AnyDuringMigration because: Argument of type 'SVGGElement | null' is not
// assignable to parameter of type 'EventTarget'.
this.onMouseUpWrapper_ = browserEvents.conditionalBind(
this.svgGroup_ as AnyDuringMigration, 'mouseup', this, this.onMouseUp_);
this.svgGroup_ as AnyDuringMigration, 'pointerup', this,
this.onMouseUp_);
return this.svgGroup_!;
}
@@ -244,9 +245,9 @@ export class FlyoutButton {
/**
* Do something when the button is clicked.
*
* @param e Mouse up event.
* @param e Pointer up event.
*/
private onMouseUp_(e: Event) {
private onMouseUp_(e: PointerEvent) {
const gesture = this.targetWorkspace.getGesture(e);
if (gesture) {
gesture.cancel();