Skip to content

Commit 071ae26

Browse files
committed
fix(core): the controller leaves a mouse press on a group's action to its tracker
Where the primary pointer is coarse the controller paints a mouse press itself (#8046). It now skips an action a group's tracker paints for a pointer's press, a mouse's included, as it already did for a finger, so the two never write the press attribute over each other. A Space press on the action still paints: the group tracks pointers only.
1 parent 6001255 commit 071ae26

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎packages/core/src/utils/pressFeedback.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,9 @@ function stylesheetDroppedActive(): boolean {
460460

461461
/**
462462
* The surface a mouse button's or the Space key's press paints, if any: the
463-
* innermost marked surface, outside a menu. A key's press paints only a
464-
* focused element that is itself the surface, as `:active` does.
463+
* innermost marked surface, outside a menu and off an action a group's
464+
* tracker paints. A key's press paints only a focused element that is
465+
* itself the surface, as `:active` does.
465466
*/
466467
function buttonSurfaceAt(
467468
target: EventTarget | null,
@@ -474,6 +475,11 @@ function buttonSurfaceAt(
474475
if (pointerId == null && element !== target) {
475476
return null;
476477
}
478+
// A group's tracker paints a pointer's press on its actions, a mouse's too;
479+
// a key's press is the action's own.
480+
if (pointerId != null && trackedByGroup(element)) {
481+
return null;
482+
}
477483
return element;
478484
}
479485

0 commit comments

Comments
 (0)