Skip to main content

DetectDirtyController

Purpose

Track whether an <input>, <textarea> or <select> has changed their value from the value they loaded with.

Adds data-dirty to the input being watched if it changes value, and removes it if it returns to its initial value.

Actions

ActionPurpose
restoreReturn the input to its original value

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
----

Events

EventWhenDispatched onevent.detail
input-dirtied-the input, textarea or select that changedtarget: the input that changed
input-cleaned-the input, textarea or select that changedtarget: the input that changed

Side Effects

Adds input and change event listeners to the attached input.

How to Use