material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[material-ui][dialog] form dialog has invalid aria role in docs

Open objectfoo opened this issue 1 year ago • 2 comments

Steps to reproduce

Example from mui documentation:

Steps:

  1. open form dialog
  2. launch chrome lighthouse tool

Current behavior

The form dialog example has an invalid aria role. image

The form element needs to wrap both the DialogContent and DialogActions in order to work correctly, doing this will break the scroll-ability of a dialog with content longer than the window.

Expected behavior

It should not have an aria role issue, or it should allow DialogContent scroll-ability when there is a form element wrapping DialogTitle, DialogContent and DialogActions.

Context

No response

Your environment

This is in the mui docs.

Search keywords: accessibility dialog form

objectfoo avatar Feb 14 '24 18:02 objectfoo

Hey there, @objectfoo; thanks for opening the issue! I'm not being able to see this error myself, though, either through running Lighthouse or PageSpeed Insights (however, I do see another accessibility-related error regarding the lack of associated labels, even though there's the aria-labelledby attribute already 🤔).

danilo-leal avatar Feb 15 '24 02:02 danilo-leal

You're not seeing it on the Form Dialog example on the dialog docs? Where it uses PaperProps to change the component to a form? I think this is the issue, form is not allowed to have role="dialog".

Open the dialog and then run lighthouse without reloading image

image

Same thing is happening to my QA on some of my user code.

objectfoo avatar Feb 15 '24 15:02 objectfoo