chakra-ui-vue icon indicating copy to clipboard operation
chakra-ui-vue copied to clipboard

leastDestructiveRef of CAlertDialog seems not working

Open odiak opened this issue 3 years ago • 0 comments

Describe the bug I specified CAlertDialog's leastDestructiveRef with ref of second button, but the first button was initially focused.

<CAlertDialog
    :is-open="isOpen"
    :least-destructive-ref="$refs.cancelRef"
    :on-close="closeDialog">
  <CAlertDialogOverlay />
  <CAlertDialogContent>
    <CAlertDialogHeader>...</CAlertDialogHeader>
    <CAlertDialogBody>...</CAlertDialogHeaderBody>
    <CAlertDialogFooter>
      <CButton>Do it</CButton>
      <CButton ref="cancelRef">Cancel</CButton>
    </CAlertDialogHeaderFooter>
  </CAlertDialogContent>
</CAlertDialog>

Expected behavior Second button is focused initially.

odiak avatar Oct 10 '22 20:10 odiak