ux icon indicating copy to clipboard operation
ux copied to clipboard

[LiveComponents] RFC: change default behavior to set model on "change" instead of input

Open weaverryan opened this issue 3 years ago • 3 comments

Right now, if you have:

<input data-model="name">

Then the model will be set (and an Ajax call will be made to re-render) while your typing. It waits until you stop typing for a moment (debouncing), but if you typed Ryan (short pause) then Weaver, that would create 2 Ajax requests.

You can currently alter this behavior to not send the Ajax request until the field changes with:

<input data-model="on(change)|name">

For an input field, this means you stop typing and then "leave" the field.

Proposal

The proposal is to reverse the default value so that models update based on change by default. You could change to the previous default behavior via on(input)|name.

The motivation behind this is that Livewire is planning to change this for their v3. I like keeping consistency with Livewire when possible. And more importantly, they have a lot of real-world experience, and if they are going through the BC-breaking change of reversing the default, it's probably for a good reason (the reason is stated as reducing unnecessary work/Ajax requests).

weaverryan avatar Oct 07 '22 20:10 weaverryan

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Apr 26 '24 12:04 carsonbot

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

carsonbot avatar May 11 '24 07:05 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar May 25 '24 14:05 carsonbot