mirror of
https://github.com/stashapp/stash.git
synced 2026-01-04 22:56:59 +01:00
Fix placeholder in string list input (#3257)
This commit is contained in:
parent
2715dcb72a
commit
a67eee8f4c
2 changed files with 4 additions and 3 deletions
|
|
@ -429,7 +429,7 @@ export const StringListSetting: React.FC<IStringListSetting> = (props) => {
|
|||
<StringListInput
|
||||
value={value ?? []}
|
||||
setValue={setValue}
|
||||
defaultNewValue={props.defaultNewValue}
|
||||
placeholder={props.defaultNewValue}
|
||||
/>
|
||||
)}
|
||||
renderValue={(value) => (
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import Icon from "src/components/Shared/Icon";
|
|||
interface IStringListInputProps {
|
||||
value: string[];
|
||||
setValue: (value: string[]) => void;
|
||||
defaultNewValue?: string;
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
errors?: string;
|
||||
}
|
||||
|
||||
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) {
|
||||
const newValues = values
|
||||
|
|
@ -43,6 +43,7 @@ export const StringListInput: React.FC<IStringListInputProps> = (props) => {
|
|||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
valueChanged(i, e.currentTarget.value)
|
||||
}
|
||||
placeholder={props.placeholder}
|
||||
/>
|
||||
<InputGroup.Append>
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Reference in a new issue