mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix placeholder in string list input (#3257)
This commit is contained in:
@@ -429,7 +429,7 @@ export const StringListSetting: React.FC<IStringListSetting> = (props) => {
|
|||||||
<StringListInput
|
<StringListInput
|
||||||
value={value ?? []}
|
value={value ?? []}
|
||||||
setValue={setValue}
|
setValue={setValue}
|
||||||
defaultNewValue={props.defaultNewValue}
|
placeholder={props.defaultNewValue}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
renderValue={(value) => (
|
renderValue={(value) => (
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import Icon from "src/components/Shared/Icon";
|
|||||||
interface IStringListInputProps {
|
interface IStringListInputProps {
|
||||||
value: string[];
|
value: string[];
|
||||||
setValue: (value: string[]) => void;
|
setValue: (value: string[]) => void;
|
||||||
defaultNewValue?: string;
|
placeholder?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
errors?: string;
|
errors?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const StringListInput: React.FC<IStringListInputProps> = (props) => {
|
export const StringListInput: React.FC<IStringListInputProps> = (props) => {
|
||||||
const values = props.value.concat(props.defaultNewValue || "");
|
const values = props.value.concat("");
|
||||||
|
|
||||||
function valueChanged(idx: number, value: string) {
|
function valueChanged(idx: number, value: string) {
|
||||||
const newValues = values
|
const newValues = values
|
||||||
@@ -43,6 +43,7 @@ export const StringListInput: React.FC<IStringListInputProps> = (props) => {
|
|||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
valueChanged(i, e.currentTarget.value)
|
valueChanged(i, e.currentTarget.value)
|
||||||
}
|
}
|
||||||
|
placeholder={props.placeholder}
|
||||||
/>
|
/>
|
||||||
<InputGroup.Append>
|
<InputGroup.Append>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user