downshift-js / downshift

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.
http://downshift-js.com/
MIT License
12.06k stars 929 forks source link

feat(hooks): remove mouse and touch events on unmount #1581

Closed silviuaavram closed 6 months ago

silviuaavram commented 6 months ago

What: Remove the mouse and touch event handlers on unmount.

Why: The previous implementation was removing the handlers and adding new ones on each isOpen change.

How: Removed the isOpen dependency from the hook and moved the logic to the callback passed by useCombobox and useSelect.

Checklist:

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (32d675d) to head (1c2da99).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1581 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 18 18 Lines 1755 1749 -6 Branches 529 524 -5 ========================================= - Hits 1755 1749 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 8.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: