<><dap-ds-buttononclick="document.getElementById('tray-bottom').open=true">Open Modal</dap-ds-button><dap-ds-modalid="tray-bottom"><dap-ds-typographyvariant="h1"slot="title">Like a tray?</dap-ds-typography><p>Opened like a tray</p><dap-ds-buttonslot="footer"onclick="document.getElementById('tray-bottom').open=false">I like tray</dap-ds-button><dap-ds-buttondangerslot="footer"onclick="document.getElementById('tray-bottom').open=false">I don't ike tray</dap-ds-button></dap-ds-modal></>
Events
Modal has many events according to its state. You can listen to these events to trigger some actions.
Most important event is the dds-close event, which is triggered when the modal is closed.
The events detail properry contains the source of the event. This can be ok-button, cancel-button, close-button, overlay, or esc.
Issues
There is a know issue in Safari when using React. When the modal is opened, safari does not recognize the content in the modal content slot, andthe content is not resized to the new height. This is a known Safari bug.
I this case you can set the modal to a fixed size, or use the the followin css: