Kuba
Kuba
RReactiflux
Created by Kuba on 9/2/2023 in #help-threads-react
kuba_huba – 17-21 Sep 2
I'm just missing why would the event on the button seem to "persist" after the element changes to a different one.
7 replies
RReactiflux
Created by Kuba on 9/2/2023 in #help-threads-react
kuba_huba – 17-21 Sep 2
This SO question (https://stackoverflow.com/a/74083342/7585847) helped me, but as explained:
This could also be the React virtual DOM not realizing it is a different button while the event is propagating through, and passing the reference that was to the "edit" button to the new "send" button and rendering it in place while the effect of the button click on edit button still propagating, therefore effectively, submitting when it hits the form.
7 replies
RReactiflux
Created by Kuba on 9/2/2023 in #help-threads-react
kuba_huba – 17-21 Sep 2
By weird behavior I mean that when the pagination.isLastPage changed and buttons also changed the submit event was fired instantly, despite button with type="submit" not being pressed.
7 replies
RReactiflux
Created by Kuba on 5/20/2023 in #help-threads-react
✅ – ✅ – Kuba – 22-47 May 20
Have a nice Sunday Zeno! I'm marking the thread as solved.
19 replies
RReactiflux
Created by Kuba on 5/20/2023 in #help-threads-react
✅ – ✅ – Kuba – 22-47 May 20
Thanks once more!
19 replies
RReactiflux
Created by Kuba on 5/20/2023 in #help-threads-react
✅ – ✅ – Kuba – 22-47 May 20
I wanted to have the value displayed and updated, thus internally I was "intercepting" onChange event and setting the value in local state manually. But controller exposes missing value, which I needed so that solves my problem
19 replies
RReactiflux
Created by Kuba on 5/20/2023 in #help-threads-react
✅ – ✅ – Kuba – 22-47 May 20
Thank you for the time spent on this! Version with the Controller is the way to go. After all my component is a controlled input, and that's what the Controller exists for in RHF.
19 replies
RReactiflux
Created by Kuba on 5/20/2023 in #help-threads-react
✅ – ✅ – Kuba – 22-47 May 20
It's updated (and shown for the first time) when it's modified because there's an event handler, but the value is initially missing, and it's not up to date after reset
19 replies