Cursor won't remain set to its assigned style whilst click-and-dragging to move a View
Author: shirakabaCreated Jul 3, 2018Updated Mar 25, 2019
Labelsbug
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
$ node_modules/.bin/react-native-macos info
Environment:
OS: macOS High Sierra 10.13.5
Node: 9.11.1
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: Not Found
react-native-macos: 0.18.0-alpha.3Aim
Basically I want the cursor to imitate the accessible behaviour you'd expect from NSSplitViewController: the cursor style should reflect whether it's hovering over the divider or not.
Steps to Reproduce
Run the code from the Reproducible Demo section.
- Move your cursor onto the pale-cloured divider bar
- Try clicking-and-dragging, moving it from side-to-side.
- Release your cursor.
- Move your cursor off the divider.
Expected Behaviour
- The cursor should become set to
resizeLeftRightstyle. - The cursor should remain in
resizeLeftRightstyle. - The cursor should remain in
resizeLeftRightstyle provided that it's still overlapping the divider bar. - The cursor should return to
arrowstyle.
Actual Behavior
- ✅
- ╳ The cursor returns to
arrowstyle. Even if an adaptation is added to restoreresizeLeftRightstyle upon any call of thewhilstDraggingfunction, the cursor will repeatedly fight to return toarrowstyle. I think this is related to the divider changing position (possibly re-rendering in the process, and affecting the responder behaviour), but I'm not sure. - ✅ (maybe by co-incidence)
- ✅ (maybe by co-incidence)
See video on Twitter.
Reproducible Demo
Use the code snippet from this Snack with react-native-macos.
Note: commit 7c8be91 from July 3rd 2018 to master must first be applied to fix the Cursor module import issue.
Source: ptmt/react-native-macos