react-beautiful-dnd
react-beautiful-dnd copied to clipboard
Adding axis lock
Fixes #538
lockedAxis and allowedDeviation properties on <Draggable /> restricting dragging to one axis but permitting some movement in the blocked axis.
The main counter point was that this library is meant to feel physical so outright blocking movement in one axis feels like you are interacting with software as not many physical things are "on rails". However sometimes you do just need to lock movement to one axis but given some allowed deviation along the blocked axis (for instance 40px deviation allows -40px to +40px along the blocked axis).
There is a slight problem that I've seen on previous external solutions where keyboard controls are forgotten about, locked axis shouldn't be used as an alternative to type.
Hooray! All contributors have signed the CLA.
@danieldelcore would love this feature when you get the time to review
Bump