Ensure correct form's hidden input for selectedIds #891

Merged
ziraqyoung merged 1 commits from sync-bulk-select-deselect into main 2024-06-20 04:50:32 +08:00
ziraqyoung commented 2024-06-20 01:24:54 +08:00 (Migrated from github.com)

When adding transactions for bulk edit/delete, clicking on “Delete” or “Edit” icons creates hidden form inputs for the selected transactions.

If the modal is closed and a selected transaction(s) is deselected , its hidden form input is already added and wont be removed upon deselecting hence will be accidentally deleted (or updated) on submit.

This PR addresses that by reseting the paramName, before creating hidden form inputs.

https://github.com/maybe-finance/maybe/assets/41262193/a3a899dd-4cdd-41bb-990e-dd37cb50a899

When adding transactions for bulk edit/delete, clicking on “Delete” or “Edit” icons creates hidden form inputs for the selected transactions. If the modal is closed and a selected transaction(s) is deselected , its hidden form input is already added and wont be removed upon deselecting hence will be accidentally deleted (or updated) on submit. This PR addresses that by reseting the `paramName`, before creating hidden form inputs. https://github.com/maybe-finance/maybe/assets/41262193/a3a899dd-4cdd-41bb-990e-dd37cb50a899
zachgoll (Migrated from github.com) approved these changes 2024-06-20 04:47:52 +08:00
zachgoll (Migrated from github.com) left a comment

Really good catch here, and thanks for the fix! That's definitely not a fun bug to deal with as a user :)

Really good catch here, and thanks for the fix! That's definitely not a fun bug to deal with as a user :)
Sign in to join this conversation.