Dismissable/Remove Controller
Purpose
Add the ability to dismiss/remove an element from the DOM. i.e. Notifications, Flash messages. alerts
Action | Purpose |
---|
dismiss | Removes the element from the DOM |
Value | Type | Description | Default |
---|
- | - | - | - |
Events
Event | When | Dispatched on | event.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.