fix: empty event form edit fields
This commit is contained in:
parent
dbf9809c7b
commit
b5602bead5
3 changed files with 45 additions and 42 deletions
|
@ -36,6 +36,12 @@ export default function LabeledInput({
|
|||
value || defaultValue || '',
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (value !== undefined) {
|
||||
setInputValue(value);
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setInputValue(e.target.value);
|
||||
if (rest.onChange) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue