Skip to main content

Dismissable/Remove Controller

Purpose

Add the ability to dismiss/remove an element from the DOM. i.e. Notifications, Flash messages. alerts

Actions

ActionPurpose
dismissRemoves the element from the DOM

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
----

Events

EventWhenDispatched onevent.detail
----

Side Effects

None

How to Use

A good example is a flash message, rather than it staying on the page forever, allowing the user to dismiss it with a little 'X' in the corner.

Browser support / Necessary polyfills

Please reference https://caniuse.com/childnode-remove, you may need to polyfill ChildNode.remove() using https://www.npmjs.com/package/element-remove-polyfill if you need to support IE11 or below.