Make BaseDialog's div keyboard focusable and fix test. (#30631)

* Make BaseDialog's div keyboard focusable and fix test.

* Less weird test

* Update snapshots

* More snapshots
This commit is contained in:
David Langley
2025-08-27 12:41:39 +00:00
committed by GitHub
parent c6f47cfd8e
commit 87b4918d34
26 changed files with 54 additions and 1 deletions
@@ -145,6 +145,9 @@ export default class BaseDialog extends React.Component<IProps> {
const lockProps: Record<string, any> = {
"onKeyDown": this.onKeyDown,
"role": "dialog",
// Allow the dialog to be keyboard focusable
// So the escape key handling works in more cases (say you select the header)
"tabIndex": -1,
// This should point to a node describing the dialog.
// If we were about to completely follow this recommendation we'd need to
// make all the components relying on BaseDialog to be aware of it.