@@ -256,8 +256,9 @@ class MobileSemanticsEnabler extends SemanticsEnabler {
256256 @override
257257 bool tryEnableSemantics (html.Event event) {
258258 if (_schedulePlaceholderRemoval) {
259- final bool removeNow =
260- (browserEngine != BrowserEngine .webkit || event.type == 'touchend' );
259+ final bool removeNow = (browserEngine != BrowserEngine .webkit ||
260+ event.type == 'touchend' ||
261+ event.type == 'pointerup' );
261262 if (removeNow) {
262263 _semanticsPlaceholder! .remove ();
263264 _semanticsPlaceholder = null ;
@@ -288,6 +289,7 @@ class MobileSemanticsEnabler extends SemanticsEnabler {
288289 'touchstart' ,
289290 'touchend' ,
290291 'pointerdown' ,
292+ 'pointermove' ,
291293 'pointerup' ,
292294 };
293295
@@ -338,6 +340,11 @@ class MobileSemanticsEnabler extends SemanticsEnabler {
338340 final html.TouchEvent touch = event as html.TouchEvent ;
339341 activationPoint = touch.changedTouches! .first.client;
340342 break ;
343+ case 'pointerdown' :
344+ case 'pointerup' :
345+ final html.PointerEvent touch = event as html.PointerEvent ;
346+ activationPoint = new html.Point (touch.client.x, touch.client.y);
347+ break ;
341348 default :
342349 // The event is not relevant, forward to framework as normal.
343350 return true ;
@@ -346,9 +353,11 @@ class MobileSemanticsEnabler extends SemanticsEnabler {
346353 final html.Rectangle <num > activatingElementRect =
347354 domRenderer.glassPaneElement! .getBoundingClientRect ();
348355 final double midX = (activatingElementRect.left +
349- (activatingElementRect.right - activatingElementRect.left) / 2 ).toDouble ();
356+ (activatingElementRect.right - activatingElementRect.left) / 2 )
357+ .toDouble ();
350358 final double midY = (activatingElementRect.top +
351- (activatingElementRect.bottom - activatingElementRect.top) / 2 ).toDouble ();
359+ (activatingElementRect.bottom - activatingElementRect.top) / 2 )
360+ .toDouble ();
352361 final double deltaX = activationPoint.x.toDouble () - midX;
353362 final double deltaY = activationPoint.y.toDouble () - midY;
354363 final double deltaSquared = deltaX * deltaX + deltaY * deltaY;
0 commit comments