Skip to content

Commit f18c024

Browse files
committed
Remove -> prefix if no element is selected yet
1 parent f6577a8 commit f18c024

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assets/controllers/elements/structural_entity_select_controller.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export default class extends Controller {
6666
//Prepend it to the input
6767
if (current) {
6868
data.input = current + " " + data.input;
69+
} else {
70+
//If there is no current value, we remove the "->"
71+
data.input = data.input.substring(2);
6972
}
7073
}
7174

@@ -96,6 +99,9 @@ export default class extends Controller {
9699
//Prepend it to the input
97100
if (current) {
98101
input = current + " " + input;
102+
} else {
103+
//If there is no current value, we remove the "->"
104+
input = input.substring(2);
99105
}
100106
}
101107

0 commit comments

Comments
 (0)