html
html copied to clipboard
Close dialog elements when the open attribute is removed
Fixes https://github.com/whatwg/html/issues/5802
This patch adds attribute change steps to run the dialog closing steps whenever the open attribute is removed in order to prevent a bad state where the dialog is hidden but modal which renders the rest of the page inert.
- [ ] At least two implementers are interested (and none opposed):
- Chrome
- …
- [x] Tests are written and can be reviewed and commented upon at:
- https://github.com/web-platform-tests/wpt/pull/44408
- [ ] Implementation bugs are filed:
- Chromium: https://chromium-review.googlesource.com/c/chromium/src/+/5269905
- Gecko: …
- WebKit: …
- [x] MDN issue is filed: MDN already discourages modifying the open attribute, and I think its a good idea to keep it that way.
- [x] The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
/form-control-infrastructure.html ( diff ) /interactive-elements.html ( diff )
I hope other implementers are interested and that it's web-compatible.
I will ship this behind a flag, and I will let yall know if any issues come up. I don't have a usecounter for it but I don't see why this change would be a problem.
Seems reasonable modulo web compatibility. @lukewarlow might also be interested in this.
This feels like a big win for developers and having looked at the changes I don't think it's likely to cause any issues. Especially because it's unlikely developers will be relying on this behaviour (seems like its always undesirable)