SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

dialogDismiss

Closes the modal <dialog> its host sits in when the visitor presses the backdrop or follows a link inside it.

tsx
import { dialogDismiss } from "@sdxc/ui/mixins";

Usage

Listens on the host's closest <dialog> from insertion until removal. A modified click or a target="_blank" link opens the page elsewhere and leaves the dialog open, since the visitor who made it is still using it. A host outside any dialog does nothing.

Signature

typescript
dialogDismiss(): MixinDescriptor<HTMLElement>

Examples

tsx
<dialog id="menu" closedby="any">
	<span hidden mix={[dialogDismiss()]} />
	<a href="/#pricing">Pricing</a>
</dialog>
@sdxc/ui

Can’t find it? Contact us