Skip to content

Commit

Permalink
fix: Avoid duplicate entry creation from tom-select control, closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
mromulus committed Feb 15, 2024
1 parent c885c0e commit 400623f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions app/javascript/controllers/select_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export default class extends Controller {
wrapperClass: "ts-wrapper form-input",
createOnBlur: true,
create: true,
onChange: function () {
document.activeElement.blur();
},
};
} else {
const hasEmptyOption =
Expand All @@ -31,9 +28,6 @@ export default class extends Controller {
onDelete: function (values, event) {
return ismultiple || !(values.length == 1 && !hasEmptyOption);
},
onChange: function () {
document.activeElement.blur();
},
};
}
this.instance = new TomSelect(this.element, options);
Expand Down

0 comments on commit 400623f

Please sign in to comment.