mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Ensure correct form's hidden input for selectedIds (#891)
This commit is contained in:
parent
ca39b26070
commit
778098ebb0
1 changed files with 7 additions and 0 deletions
|
@ -66,6 +66,8 @@ export default class extends Controller {
|
|||
}
|
||||
|
||||
#addHiddenFormInputsForSelectedIds(form, paramName, transactionIds) {
|
||||
this.#resetFormInputs(form, paramName);
|
||||
|
||||
transactionIds.forEach(id => {
|
||||
const input = document.createElement("input");
|
||||
input.type = 'hidden'
|
||||
|
@ -75,6 +77,11 @@ export default class extends Controller {
|
|||
})
|
||||
}
|
||||
|
||||
#resetFormInputs(form, paramName) {
|
||||
const existingInputs = form.querySelectorAll(`input[name='${paramName}']`);
|
||||
existingInputs.forEach((input) => input.remove());
|
||||
}
|
||||
|
||||
#rowsForGroup(group) {
|
||||
return this.rowTargets.filter(row => group.contains(row))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue