Kevin Powell - CommunityKP-C
Kevin Powell - Community14mo ago
11 replies
snxxwyy

dialog questions

Hey, I have a couple questions regarding the dialogue element-

1) mdn recommends to avoid toggling the open attribute to enable the dialogue and to instead use .show() or .showModal() in js. Why is this?

2) I’ve seen that .show() makes the dialogue “non modal” and .showModal() makes the dialogue “modal. What’s the key differences?

3) mdn also says it’s recommended to use the autofocus attribute on important content or the close button in the dialogue. I haven’t seen this attribute until now, is it a dialogue only thing or can you use it with other things?

I’d appreciate any help, thanks in advance.
Was this page helpful?