Skip to content

DataViews: action modals without focusable elements within the modal content do not close when pressing the Esc key #69265

@oandregal

Description

@oandregal

Description

DataViews supports adding actions that have modals. When a modal is open, it can be closed by pressing the Esc key, but only if the modal has a button that calls the closeModal on click.

Step-by-step reproduction instructions

Modify the DataViews story for render modals:

  • Go to the DataViews story, where the render modal action is defined (link to code).
  • Change hideModalHeader to modalHeader: 'Delete action'.
  • Remove the buttons from the RenderModal component.

Run the storybook:

  • npm install && npm run storybook:dev
  • It'll automatically open a browser. Go to the DataViews default story at http://localhost:50240/?path=/docs/dataviews-dataviews--docs
  • Open the "Delete item" action and verify that it has a header with a close button.
  • Press the Esc key in the keyboard. The expected result was that it closed the modal, but it didn't.
  • Verify that pressing the X button in the modal header does close the modal.
Image

Metadata

Metadata

Assignees

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions