Skip to content

ConfirmationDialog with confirmButtonType danger autofocuses the destructive action #2181

@mattcosta7

Description

@mattcosta7

Describe the bug

When using a ConfirmationDialog with the confirmButtonType danger, the confirmation button is autofocused (rather than the first focusable element or the least destructive action). This makes it likely that users might accidentally perfrom destructive actions, rather than a recoverable one (like canceling)

Note: As this is a public repo, please be careful not to include details or screenshots from unreleased GitHub products or features. In most cases, a good bug report should be able to describe the new component without including business logic or feature details, but if you must discuss context relating to an unreleased feature, please open an issue in the private Design Systems repo and link to it here.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a confirmation dialog with a confirmButtonType=danger
  2. Open the dialog
  3. note, that the 'confirm' button, which in this case is a dangerous action is autofocus

Expected behavior

The least destructive action receives autofocus - or that autofocus behavior is customizable

Screen.Recording.2022-07-21.at.8.28.21.AM.mov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions