From 400623fa9c05bc815b027500884d4da9408284b7 Mon Sep 17 00:00:00 2001 From: Mikk Romulus Date: Thu, 15 Feb 2024 14:06:52 +0200 Subject: [PATCH] fix: Avoid duplicate entry creation from tom-select control, closes #35 --- app/javascript/controllers/select_controller.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/javascript/controllers/select_controller.js b/app/javascript/controllers/select_controller.js index b0d0820c..00d6083a 100644 --- a/app/javascript/controllers/select_controller.js +++ b/app/javascript/controllers/select_controller.js @@ -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 = @@ -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);