Skip to content

Commit

Permalink
refs #92568 - fixes duplicate link being added after saving nested form
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybones90 committed Jan 21, 2022
1 parent f021b3e commit a329e60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/assets/javascripts/fae/form/inputs/_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ Fae.form.select = {
})
});

// Add actions to wraper
$deselect_all_action.insertAfter($chosen);
// prevent duplicate link from being added when nested form re-renders on the page after saving
if (!$('.js-multiselect-action-deselect_all').length > 0) {
// Add actions to wraper
$deselect_all_action.insertAfter($chosen);
}

// Add special "Select All" option and notify Chosen of new option
addSelectAllOption($element)
Expand Down

0 comments on commit a329e60

Please sign in to comment.