inputRef.current?.focus()}
+ >
+ {/* Display existing tags */}
+ {value.map((tag, index) => (
+
+ {tag}
+
+
+ ))}
+
+ {/* Input for new tags */}
+ {(!maxTags || value.length < maxTags) && (
+
+
setInputValue(e.target.value)}
+ onKeyDown={handleKeyDown}
+ onFocus={() => inputValue && setShowSuggestions(filteredSuggestions.length > 0)}
+ onBlur={() => setTimeout(() => setShowSuggestions(false), 200)}
+ placeholder={placeholder}
+ className={cn("border-0 ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 p-0 h-8", inputClassName)}
+ disabled={disabled}
+ />
+
+ {/* Suggestions dropdown */}
+ {showSuggestions && (
+
+ {filteredSuggestions.map((suggestion) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {/* Add button for mobile usability */}
+ {inputValue && !disabled && (
+
+ )}
+