Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] dialog element #6730

Closed
OmidHekayati opened this issue Jun 2, 2021 · 0 comments
Closed

[Suggestion] dialog element #6730

OmidHekayati opened this issue Jun 2, 2021 · 0 comments
Labels
topic: dialog The <dialog> element.

Comments

@OmidHekayati
Copy link

OmidHekayati commented Jun 2, 2021

As discussed here w3c/html#860 and here w3c/html#1667 and to improve this proposal #5802 (comment) I suggest adding below to the dialog standard:

  • I disagree to add a new element to HTML as <popup> because as a semantic view, the popup is just type of a dialog and doesn't introduce new behaviors! I think we just need a new attribute as type= with these values [modal, menu, alert] in <dialog>
  • Remove the showModal() method due to the type of dialog must declare as type attribute!
  • New JS method as toggle() to toggle the dialog open||close state! open if it is in a close state and close if it is in an open state!
  • New attribute as onBackdropClick that gets a function name that if type=modal set, the application (usually a browser) will call that function when the user interacts with outside of dialog! e.g. onBackdropClick="this.toggle" that toggle dialog open state!. The name of the attribute is discussable!
  • As discuss Have some way of opening <dialog> elements without JavaScript #3567 and accessibility dialog must always be controlled by an HTML element like a to open||close it not just by javascript, I think we need another attribute like "control-by" just like aria-owns or aria-controls for the dialog element. I'm not sure about this one that needs more discussion due to dialog can control by more than one element like an open button outside of dialog and a close button inside of dialog!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: dialog The <dialog> element.
Development

No branches or pull requests

3 participants