You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b206f63
Browse filesBrowse the repository at this point in the historyBrowse files
fix(core): a touch press's release lasts until its fade has played (#9758)
* fix(core): a touch press's release lasts until its fade has played
Under a finger, the touch press controller ended a press's release on a
clock that starts at the lift. When script delays the first frame of the
release animation, the animation ends later, but the clock does not, so
the highlight was cut off mid-fade. When the clock runs out, the
controller now waits for a release animation that still runs or still
waits for its first frame: on the surface, its ::before or ::after, or on
a part inside it whose nearest press owner is the surface. With none, the
release ends at the clock, as before.
Rebased onto main after #8360 landed: main's theme tempo already caps the
release under Reduce Motion, so only the release-ends-with-its-animation
part remains.
Co-authored-by: Cindy Zhang <cindyxz@meta.com>
* docs(core): the press clock's comments say the release waits for its animation
CodeBunny's notes on the first round: pressGesture.ts still described
PRESS_FADE_MS as the timer that removes the attribute, and two new
comments in pressFeedback.ts had sentences over 25 words.
* Merge main into the press release change
Main's #8638 renamed the release clock helper fadeMs to an exported
pressFadeMs. The release call here now uses pressFadeMs; nothing else
in this pull request changes.
Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
[fix] Under a finger, a press's release now lasts until its fade has played. The touch press controller ended the release on a clock started at the lift, so when the page's script delayed the fade's first frame, the release was cut short mid-fade. It now ends when the press's release animation ends, on the surface or on a part inside it that a component draws the release on, or on its clock where no release animation runs (an instant release, a surface without one, or an engine without Web Animations). This applies to every surface the touch press controller drives: buttons, switches, checkboxes, cards, menu rows and list rows.
it('waits for no animation that is not this press’s running release: a nested press owner’s (on it or inside it), an endless one, or one already finished',async()=>{
785
+
liftHeldPress();
786
+
// A press owner inside the row: its release is its own press's, never
0 commit comments