<!-- Transition or Animate a <dialog> Modal Open + closed state
Problem: The browser display:none; → display:block; on <dialog> when the modal opens. This means we can't transiton between then.
Solitions? 1. Use an animation on [open] or :modal. This works on opening, but does not work when closing since its immediately display: none; 2. display:block; and then visually hide. This works, but now the modal is a focus trap. pointer-events and user-select help mouse events, but not keyboard
Is the only way to animate both IN and OUT to do a bunch of sequental class add + remove with JS?!
<dialogid="dialog"> <h2>Hello</h2> <p>click the button or press esc to close</p> <inputtype="text"placeholder="Youy shouldnt be able to type in me until I'm open"> <formmethod="dialog"> <buttontype="submit">Close</button> </form> </dialog>