Comment by hunvreus
3 days ago
Yeah, I looked into it but wanted to avoid adding plugins.
I already do a bit of (simple) focusing here and there, so it shouldn't leave the focus on the background:
https://github.com/hunvreus/basecoat/blob/main/src/js/dialog...
But more complex scenario require you to be specific about the field you want to see focused. I was thinking about allowing you designate the field to focus on.
What would you suggest?
Why aren't you just using the built-in dialog element that already handles this?
<dialog> is kind of a PITA to style (backdrop, transitions, etc), and doesn't really solve any of the tough problems with dialogs (e.g. locking scrolling).
I tried really hard to use <dialog> and popover but didn't succeed. Maybe somebody more skilled can make it happen.