Skip to content

fix(coordinates): honor an explicit zero swipe/scroll duration - #244

Open
Atishyy27 wants to merge 1 commit into
google:mainfrom
Atishyy27:fix/swipe-duration-zero
Open

Atishyy27 wants to merge 1 commit into
google:mainfrom
Atishyy27:fix/swipe-duration-zero

Conversation

@Atishyy27

Copy link
Copy Markdown

parse_swipe_parameters picked the duration with an or-chain, so an integer 0 was falsy and got replaced by the 800 ms default, while the string "0" survived as 0 ms. The same value behaved differently by type.

The fix takes the first key whose value is usable as a duration (present, not a bool, convertible to int). An explicit 0 is honored; empty or invalid values still fall back to the default. The new test fails on main for the integer-zero case and passes here.

This replaces #82, which I closed after the repo history was rewritten and its diff no longer applied.

parse_swipe_parameters picked the duration with an or-chain, so an integer 0 was falsy and replaced by the 800 ms default while the string "0" survived as 0 ms. Select the first key whose value is usable as a duration instead; empty or invalid values still fall back to the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant