Purpose
A controller that listens for input
and change
events on the <input>
, <select>
or <textarea>
element the
controller is attached to, and notifies any other Signal controllers that have subscribed by referencing
the same nameValue
as this controller, or the same name attribute of the element that this controller is attached to.
This controller works in conjunction with the other Signal*
controllers to enable more complex interactions
based on changes to inputs and their values.
This controller will also synchronize the value of two inputs that have the same nameValue
or the same name attribute.
Value | Type | Description | Default |
---|
name (Optional) | String | The name of the input value whose value to react to. By default this is the name attribute of the input this controller is attached to. You can override the name used by providing this value. | The [name] attribute of the controller root element |
debounceInterval (Optional) | String | The amount of time in milliseconds to debounce input events by. If you only want input events to trigger 1 second after the user stops typing, specify "1000". | 1000 |
triggerChange (Optional) | Boolean | (Only applies when another SignalInputController emits a value change, and the current instance syncs to match) Whether to trigger a change event on the input element when the value changes. | false |
triggerInput (Optional) | Boolean | (Only applies when another SignalInputController emits a value change, and the current instance syncs to match) Whether to trigger an input event on the input element when the value changes. | false |
Events
Event | When | Dispatched on | event.detail | |
---|
signal:value:#{nameValue} | When the value of the attached input changes | The controller root element | value | The new value of the input |
Side Effects
Installs change
and input
event handlers on the element this controller is attached to.
How to Use