AirLabsTeam / react-drag-to-select

A react library which adds drag to select to your app
https://airlabsteam.github.io/react-drag-to-select
MIT License
157 stars 22 forks source link

Adjust threshold logic to improve one-dimensional selections #46

Closed 0rvar closed 3 months ago

0rvar commented 5 months ago

We've run into problems when trying to use this library for one-dimensional selections (rather than box selections). When selecting in a single direction, some trackpads will only move the cursor along a single axis, which meant that the area-based threshold for selection would not be triggered. This PR adjust the threshold logic to be based on width+height of the selection box rather than area.

Before: 2024-05-31 11 04 36

After: 2024-05-31 11 07 35