Readonly
contextReadonly
dismissedStatic
blessingsStatic
classesStatic
outletsStatic
targetsStatic
valuesStatic
shouldSend a PATCH request to the server to update the dismissible state for the given ID and update value.
Optional
event: Event & { params?: { value?: string | boolean } }The event that triggered the patch, with optional params. The param can technically be any value, but we currently only use booleans and strings.
Upon activating the toggle, send an update to the server and add the appropriate class and data attribute optimistically. Each dismissible defines how it uses (or not) these indicators.
Optional
event: Event & { params?: { value?: string | boolean } }Static
after
Adds the ability to make an element dismissible so that it updates it's class and makes an async request. Initialize such elements with a default handler that performs the dismissal. This only initializes elements that are rendered by the server (if they have the data attr), so elements that are rendered by the client (e.g. React) needs to be handled separately.
Example