GeekyAnts / GeekyAnts/NativeBase
AlertDialog leastDestructiveRef is useless
- Dominant language
- TypeScript
- Stars
- 20.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
### 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
1. Go to https://docs.nativebase.io/alert-dialog
2. The sole example has "Cancel" set as leastDestructiveRef, but even that one defaults to the [X] close button instead of the referenced button.
3. Opening the modal and then hitting Enter uses the [X] instead of the [Cancel] button.
4. 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_
Contributor guide
Assessment
This issue has not been assessed yet.