0 ? "gap-3" : ""} ${
+ className={cn(
+ `w-full flex`,
+ !inlineTags && tags.length > 0 && "gap-3",
inputFieldPosition === "bottom"
? "flex-col"
: inputFieldPosition === "top"
? "flex-col-reverse"
: "flex-row"
- }`}
+ )}
>
{!usePopoverForTags &&
(!inlineTags ? (
@@ -472,7 +500,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
disabled={disabled}
/>
) : (
- !enableAutocomplete && (
+ !useAutocompleteComponent && !autocompleteContent && (
)
))}
- {enableAutocomplete ? (
+ {!useAutocompleteComponent && autocompleteContent && (
+
+
+
+ = maxTags
+ ? placeholderWhenFull
+ : placeholder
+ }
+ value={mainInputValue}
+ onChange={handleInputChange}
+ onKeyDown={handleKeyDown}
+ onFocus={handleInputFocus}
+ onBlur={handleInputBlur}
+ {...inputProps}
+ className={cn(
+ "border-0 px-2 h-5 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 flex-1 w-fit shadow-none inset-shadow-none",
+ styleClasses?.input
+ )}
+ autoComplete="off"
+ disabled={
+ disabled ||
+ (maxTags !== undefined && tags.length >= maxTags)
+ }
+ />
+
+ {autocompleteContent}
+
+ )}
+ {useAutocompleteComponent ? (
= maxTags ? placeholderWhenFull : placeholder}
// ref={inputRef}
- // value={inputValue}
+ // value={mainInputValue}
// disabled={disabled || (maxTags !== undefined && tags.length >= maxTags)}
// onChangeCapture={handleInputChange}
// onKeyDown={handleKeyDown}
@@ -601,7 +697,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
? placeholderWhenFull
: placeholder
}
- value={inputValue}
+ value={mainInputValue}
onChange={handleInputChange}
onKeyDown={handleKeyDown}
onFocus={handleInputFocus}
@@ -662,7 +758,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
{/* = maxTags ? placeholderWhenFull : placeholder}
ref={inputRef}
- value={inputValue}
+ value={mainInputValue}
disabled={disabled || (maxTags !== undefined && tags.length >= maxTags)}
onChangeCapture={handleInputChange}
onKeyDown={handleKeyDown}
@@ -685,14 +781,14 @@ export function TagInput({ ref, ...props }: TagInputProps) {
? placeholderWhenFull
: placeholder
}
- value={inputValue}
+ value={mainInputValue}
onChange={handleInputChange}
onKeyDown={handleKeyDown}
onFocus={handleInputFocus}
onBlur={handleInputBlur}
{...inputProps}
className={cn(
- "border-0 px-0 h-5 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 flex-1 w-fit shadow-none inset-shadow-none",
+ "border-0 px-2 h-5 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 flex-1 w-fit shadow-none inset-shadow-none",
// className,
styleClasses?.input
)}
@@ -741,7 +837,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
{/* = maxTags ? placeholderWhenFull : placeholder}
ref={inputRef}
- value={inputValue}
+ value={mainInputValue}
disabled={disabled || (maxTags !== undefined && tags.length >= maxTags)}
onChangeCapture={handleInputChange}
onKeyDown={handleKeyDown}
@@ -763,14 +859,14 @@ export function TagInput({ ref, ...props }: TagInputProps) {
? placeholderWhenFull
: placeholder
}
- value={inputValue}
+ value={mainInputValue}
onChange={handleInputChange}
onKeyDown={handleKeyDown}
onFocus={handleInputFocus}
onBlur={handleInputBlur}
{...inputProps}
className={cn(
- "border-0 px-0 h-5 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 flex-1 w-fit shadow-none inset-shadow-none",
+ "border-0 px-2 h-5 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 flex-1 w-fit shadow-none inset-shadow-none",
// className,
styleClasses?.input
)}
@@ -806,7 +902,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
? placeholderWhenFull
: placeholder
}
- value={inputValue}
+ value={mainInputValue}
onChange={handleInputChange}
onKeyDown={handleKeyDown}
onFocus={handleInputFocus}
@@ -866,7 +962,7 @@ export function TagInput({ ref, ...props }: TagInputProps) {
? placeholderWhenFull
: placeholder
}
- value={inputValue}
+ value={mainInputValue}
onChange={handleInputChange}
onKeyDown={handleKeyDown}
onFocus={handleInputFocus}