mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
fix(web): fix values persisting across input dialogs opened quickly
This commit is contained in:
@@ -72,10 +72,9 @@ const InputDialog: React.FC = () => {
|
|||||||
<ModalHeader textAlign="center">{fields.heading}</ModalHeader>
|
<ModalHeader textAlign="center">{fields.heading}</ModalHeader>
|
||||||
<ModalBody fontFamily="Poppins" textAlign="left">
|
<ModalBody fontFamily="Poppins" textAlign="left">
|
||||||
{fields.rows.map((row: IInput | ICheckbox | ISelect | INumber | ISlider, index) => (
|
{fields.rows.map((row: IInput | ICheckbox | ISelect | INumber | ISlider, index) => (
|
||||||
<React.Fragment key={`row-${index}`}>
|
<React.Fragment key={`row-${index}-${row.type}-${row.label}`}>
|
||||||
{row.type === 'input' && (
|
{row.type === 'input' && (
|
||||||
<InputField
|
<InputField
|
||||||
key={`input-${index}`}
|
|
||||||
row={row}
|
row={row}
|
||||||
index={index}
|
index={index}
|
||||||
handleChange={handleChange}
|
handleChange={handleChange}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const CheckboxField: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box mb={3} key={`checkbox-${props.index}`}>
|
<Box mb={3}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.handleChange(e.target.checked, props.index)}
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.handleChange(e.target.checked, props.index)}
|
||||||
defaultChecked={props.row.checked}
|
defaultChecked={props.row.checked}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const SelectField: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box mb={3} key={`select-${props.row.label}-${props.index}`}>
|
<Box mb={3}>
|
||||||
<Select
|
<Select
|
||||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => props.handleChange(e.target.value, props.index)}
|
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => props.handleChange(e.target.value, props.index)}
|
||||||
defaultValue={props.row.default || ''}
|
defaultValue={props.row.default || ''}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const SliderField: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box mb={3} key={`slider-${props.index}`}>
|
<Box mb={3}>
|
||||||
<Label label={props.row.label} description={props.row.description} />
|
<Label label={props.row.label} description={props.row.description} />
|
||||||
<Slider
|
<Slider
|
||||||
onChangeEnd={(val: number) => props.handleChange(val, props.index)}
|
onChangeEnd={(val: number) => props.handleChange(val, props.index)}
|
||||||
|
|||||||
Reference in New Issue
Block a user