NativeBase
NativeBase copied to clipboard
AlertDialog leastDestructiveRef is useless
Description
AlertDialog should put focus on the leastDestructiveRef when the alert is opened.
CodeSandbox/Snack link
https://snack.expo.dev/@jasontank/leastdestructiveref
Steps to reproduce
- Go to https://docs.nativebase.io/alert-dialog
- The sole example has "Cancel" set as leastDestructiveRef, but even that one defaults to the [X] close button instead of the referenced button.
- Opening the modal and then hitting Enter uses the [X] instead of the [Cancel] button.
- The expected behavior happens when you use initialFocusRef instead of leastDestructiveRef, so either this is a bug or leastDestructiveRef has been deprecated and the docs need to be updated.
NativeBase Version
3.4.6
Platform
- [ ] Android
- [ ] CRA
- [X] Expo
- [ ] iOS
- [ ] Next
Other Platform
web
Additional Information
No response
Hey @jasontamez, Thanks for reporting the issue. We'll fix it.