NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

AlertDialog leastDestructiveRef is useless

Open jasontamez opened this issue 2 years ago • 1 comments

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

jasontamez avatar Aug 03 '22 02:08 jasontamez

Hey @jasontamez, Thanks for reporting the issue. We'll fix it.

ankit-tailor avatar Aug 09 '22 06:08 ankit-tailor