Skip to content

Commit 597fc21

Browse files
committed
fix(core): the delegated press registers the timing table before it resolves its roles
Under the motion-table registry (#8076: nothing registers on import, the touch code registers the tables it animates with), resolveMotion found no role for timing.press and returned the table's value, so the release fade ignored the theme's press timings. installPressAttribute now calls registerTimingTable() (idempotent) before any touch resolves them.
1 parent f25b7c2 commit 597fc21

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/core/src/gestures/delegatedPress.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
import {useEffect, useState} from 'react';
4949
import {resolveMotion} from '../motion/resolveMotion';
50-
import {timing} from '../motion/uikit/timing';
50+
import {registerTimingTable, timing} from '../motion/uikit/timing';
5151
import {PRESSABLE_ATTRIBUTE, PRESSED_ATTRIBUTE} from '../utils/pressFeedback';
5252
import {getGestureHost} from './GestureHost';
5353
import {paintPress} from './pressPaint';
@@ -106,6 +106,10 @@ export function installPressAttribute(
106106
options: PressAttributeOptions = {},
107107
): () => void {
108108
const attribute = options.attribute ?? PRESSABLE_ATTRIBUTE;
109+
// The press timings resolve as motion roles, so the timing table must be
110+
// registered before the first touch reads them (idempotent; nothing
111+
// registers on import).
112+
registerTimingTable();
109113
let byAttribute = installs.get(doc);
110114
if (byAttribute == null) {
111115
byAttribute = new Map();

0 commit comments

Comments
 (0)