You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quantiyDown which is invoked by the "minus" button
When one of this two actions are called, I need to refresh the price smoothly, and this is accomplished adding "opacity-50" class:
<pclass="font-mono transition-opacity duration-200"
data-loading="action(quantityUp)|action(quantityDown)|addClass(opacity-50)"
><!-- Computed total price --></p>
This works OK.
Now, when user manually type "43" in the quantity field, component is re-rendered without calling any specific action. Of course the "opacity-50" won't be added, because right now I'm targeting the two specific actions (quantityUp and quantiyDown).
Question: is there a way to also target the default __invoke action (that is, the component re-render) in addition to quantityUp and quantiyDown?
Bonus question: the "mic" button will grab user voice, set a value for an hidden field and triggers a re-render as the field correclty dispatch the change event. Eventually the "opacity-50" will be added too, but it shouldn't be. Is there any way to prevent this behaviour?
The text was updated successfully, but these errors were encountered:
gremo
changed the title
How to target the "__invoke" action in data-loading attribute?
[LiveComponent] How to target the "__invoke" action in data-loading attribute?
Apr 15, 2024
In my component, I have the following actions:
quantityUp
which is invoked by the "plus" buttonquantiyDown
which is invoked by the "minus" buttonWhen one of this two actions are called, I need to refresh the price smoothly, and this is accomplished adding "opacity-50" class:
This works OK.
Now, when user manually type "43" in the quantity field, component is re-rendered without calling any specific action. Of course the "opacity-50" won't be added, because right now I'm targeting the two specific actions (
quantityUp
andquantiyDown
).Question: is there a way to also target the default
__invoke
action (that is, the component re-render) in addition toquantityUp
andquantiyDown
?Bonus question: the "mic" button will grab user voice, set a value for an hidden field and triggers a re-render as the field correclty dispatch the
change
event. Eventually the "opacity-50" will be added too, but it shouldn't be. Is there any way to prevent this behaviour?The text was updated successfully, but these errors were encountered: