@@ -97,7 +97,11 @@ export function setupTagging({
97
97
updateHidden ( ) ;
98
98
input . value = "" ;
99
99
if ( suggestionsBox ) suggestionsBox . style . display = "none" ;
100
- input . classList . remove ( "invalid" , "invalid-required" , "invalid-recommended" ) ; // Remove invalid color immediately
100
+ input . classList . remove (
101
+ "invalid" ,
102
+ "invalid-required" ,
103
+ "invalid-recommended"
104
+ ) ; // Remove invalid color immediately
101
105
input . blur ( ) ;
102
106
}
103
107
@@ -107,13 +111,12 @@ export function setupTagging({
107
111
highlightTag . classList . add ( "highlight-tag" ) ;
108
112
highlightTag . innerHTML = `⚠️ Suggestion: Curate here <span class="acknowledge-tag">Got it!</span>` ;
109
113
container . insertBefore ( highlightTag , input ) ;
114
+ } else if ( ! useAutocomplete ) {
115
+ const highlightTag = document . createElement ( "span" ) ;
116
+ highlightTag . classList . add ( "highlight-tag" ) ;
117
+ highlightTag . innerHTML = `⚠️ Multiple entries supported: please press enter after typing each <span class="acknowledge-tag">Got it!</span>` ;
118
+ container . insertBefore ( highlightTag , input ) ;
110
119
}
111
- else if ( ! useAutocomplete ) {
112
- const highlightTag = document . createElement ( "span" ) ;
113
- highlightTag . classList . add ( "highlight-tag" ) ;
114
- highlightTag . innerHTML = `⚠️ Multiple entries supported: please press enter after typing each <span class="acknowledge-tag">Got it!</span>` ;
115
- container . insertBefore ( highlightTag , input ) ;
116
- }
117
120
118
121
if ( useAutocomplete && suggestionsBox ) {
119
122
input . addEventListener ( "input" , ( ) => {
@@ -203,7 +206,6 @@ export function setupTagging({
203
206
// Show all suggestions if input is empty, or filtered if not
204
207
const query = input . value . trim ( ) . toLowerCase ( ) ;
205
208
suggestionsBox . innerHTML = "" ;
206
-
207
209
// Filter as in your input event
208
210
const filtered = autocompleteSource . filter (
209
211
( tag ) =>
@@ -237,9 +239,10 @@ export function setupTagging({
237
239
} ) ;
238
240
239
241
// Position the suggestion box
240
- const rect = input . getBoundingClientRect ( ) ;
241
- updateSuggestionsBoxPosition ( input , suggestionsBox )
242
- suggestionsBox . style . position = "fixed" ;
242
+ // const rect = input.getBoundingClientRect();
243
+ updateSuggestionsBoxPosition ( input , suggestionsBox ) ;
244
+ suggestionsBox . style . display = "block" ;
245
+ suggestionsBox . style . position = "fixed" ;
243
246
} ) ;
244
247
245
248
document . addEventListener ( "click" , ( e ) => {
@@ -659,4 +662,3 @@ function setupAcknowledgeTags() {
659
662
} ) ;
660
663
} ) ;
661
664
}
662
-
0 commit comments