ReadonlycontextReadonlydebounceThe debounce delay in milliseconds, defaults to 100.
ReadonlydelayThe delay before applying the value to the target(s), defaults to 0.
If true, the sync controller is disabled and will not apply changes.
ReadonlynameA custom name to use in the event's detail object when dispatching events.
ReadonlynormalizeIf true, the value will be normalized (e.g. file input will have the extension & fakepath removed) before being applied to the target(s).
ReadonlyquietIf true, the change event will not be dispatched after applying a new value.
ReadonlytargetThe target element(s) to sync with, a CSS selector.
StaticblessingsStaticoutletsStatictargetsStaticvaluesResolve the controlled element's value that will be used for applying and event dispatching, if configured it will also normalize this value.
StaticshouldApplies a value from the controlled element to the targeted
elements. Calls to this method are debounced based on the
controller's debounceValue.
Applying of the value to the targets can be done with a delay,
based on the controller's delayValue.
Allows for targeted elements to determine, via preventing the default event, whether this sync controller should be disabled.
Clears the value of the targeted elements.
Dispatches an event to all target elements so that they can be notified that a sync has started, allowing them to disable the sync by preventing default.
Simple method to dispatch a ping event to the targeted elements.
This is the only method that will bubble by default.
Returns the non-default prevented elements that are targets of this sync controller. Additionally allows this processing to enable or disable this controller instance's sync behavior.
StaticafterAdd event listeners to adapt the SyncController apply event to the documented
wagtail:images-upload & wagtail:documents-upload events.
This intentionally overrides the existing behavior that uses delay and quiet
so that the existing event dispatching is preserved.
In a future release we may revisit this and add a deprecation path for this mechanism of event dispatching.
Adds ability to sync the value or interactions with one input with one or more targeted other inputs.
Example
Example
Todo
w-syncwith a file input