Skip to content

Commit ecad5b8

Browse files
committed
Fix batch Stimulus controller not removing inputs holding identifiers after unchecking rows
1 parent 5b2693d commit ecad5b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assets/controllers/batch.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ export default class extends Controller {
145145
}
146146

147147
for (const [identifierName, identifiers] of identifierMap) {
148+
const inputs = identifierHolder.querySelectorAll(`input[name="${identifierName}[]"]`);
149+
150+
for (const input of inputs) {
151+
input.remove();
152+
}
153+
148154
for (const identifier of identifiers) {
149155
const input = identifierHolder.querySelector(`input[name="${identifierName}[]"][value="${identifier}"]`);
150156

0 commit comments

Comments
 (0)