Skip to content

feat(GlFormInput): Add debounce/lazy support

Mark Florian requested to merge fix-input-debounce into master

What does this MR do?

feat(GlFormInput): Add debounce/lazy support

The underlying BFormInput supports a debounce prop and a lazy prop, allowing for debounced and lazy model updates respectively.

Because Vue's default model event is input, and BFormInput's model event is update, we weren't able to make use of this before, since the debounced/lazy effects of BFormInput were implemented via its update event, not its input event.

Model binding on GlFormInput happened to work prior to this because BFormInput also always synchronously emits input events for all native input DOM events.

One way to fix this would be to make GlFormInput's model match the underlying BFormInput's model, i.e., change model.event to update, rather than the implicit default input. The problem with this is that this is effectively a breaking change in our API.

Instead, we make GlFormInput's model.event explicitly input, and map update events from the underlying BFormInput to input events emitted by GlFormInput, and vice versa. This is not a breaking change.

Addresses #631 (closed).

Does this MR meet the acceptance criteria?

Conformity

Edited by Mark Florian

Merge request reports