From f18c024daab0f11ce959f8f58f3d2d75ccf31aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 24 Aug 2024 15:35:30 +0200 Subject: [PATCH] Remove -> prefix if no element is selected yet --- .../elements/structural_entity_select_controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/controllers/elements/structural_entity_select_controller.js b/assets/controllers/elements/structural_entity_select_controller.js index 48dce186..4735dd2a 100644 --- a/assets/controllers/elements/structural_entity_select_controller.js +++ b/assets/controllers/elements/structural_entity_select_controller.js @@ -66,6 +66,9 @@ export default class extends Controller { //Prepend it to the input if (current) { data.input = current + " " + data.input; + } else { + //If there is no current value, we remove the "->" + data.input = data.input.substring(2); } } @@ -96,6 +99,9 @@ export default class extends Controller { //Prepend it to the input if (current) { input = current + " " + input; + } else { + //If there is no current value, we remove the "->" + input = input.substring(2); } }