Skip to content

Commit d194ab1

Browse files
committed
refactor: use html hidden attribute instead class
1 parent 6bf1f7f commit d194ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/javascript/js/controllers/nested_form_controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class extends NestedForm {
3030

3131
toggleAddButton() {
3232
if (this.limitValue > 0) {
33-
this.addButtonTarget.classList.toggle('hidden', this.nestedRecordTargets.length >= this.limitValue)
33+
this.addButtonTarget.hidden = this.nestedRecordTargets.length >= this.limitValue
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)