Fixes issue with mapping values during the transactions import #1327
Reference in New Issue
Block a user
Delete Branch "custom-debounce-timeout-for-autosubmit-form"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why?
At the final step of a transactions import, the summary showing how many new items will be added displays numbers that don’t match the options selected in the previous steps.
I imported a CSV with 2 rows, mapped every category, tag, and account, but the summary shows that some of those items will be created.
If I go back to the mapping step, I can see that some of the selected options were cleared.
The issue was caused by the debounce timeout in the auto-submit-form Stimulus controller. It waits 500ms to submit the form, so if you click the 'Next' button too quickly, the form doesn't get submitted, and the option isn't saved.
What?
I added a default debounce timeout that adjusts based on the element type, and also made it customizable by allowing a custom debounce timeout to be set through a data attribute
What should we test?
Select an item during the mapping step when importing transactions and quickly move to the next step. At the final step of the import, you should now see a 0 next to Categories, Accounts, and Tags.
Thanks for tackling this one!