-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I have the following form:
<.simple_form id="message-form" phx-change="validate" for={@form} phx-submit="send">
<.input
phx-throttle="1000"
class={[
"message-input",
@form_disabled && "disabled"
]}
type="TextField"
field={@form[:message]}
label="Message"
/>
<:actions>
<LiveButton
class={[
@form_disabled && "disabled"
]}
type="submit"
>
<Image class="button-send" systemName="sailboat"/>
</LiveButton>
</:actions>
</.simple_form>
the phx-throttle="1000"
on the input should prevent the phx-change
event from firing more than once per second.
The behavior is described here: https://hexdocs.pm/phoenix_live_view/bindings.html#rate-limiting-events-with-debounce-and-throttle
So fire immediately then ignore additional events until the timer in ms is expired.
It does appear that we have throttle behavior in the lib but maybe these aren't applying for form's in the way described above. This is supported on Web.
Metadata
Metadata
Assignees
Labels
No labels