mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-03 20:41:07 +02:00
fix copilot compose text bug
This commit is contained in:
parent
120dbd24e9
commit
bf51dd442d
1 changed files with 5 additions and 0 deletions
|
|
@ -35,6 +35,11 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(({
|
||||||
const [validationError, setValidationError] = useState<string | undefined>();
|
const [validationError, setValidationError] = useState<string | undefined>();
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
|
|
||||||
|
// update local value when prop value changes
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalValue(propValue as string);
|
||||||
|
}, [propValue]);
|
||||||
|
|
||||||
// Sync local state with prop value when not editing
|
// Sync local state with prop value when not editing
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEditing) {
|
if (!isEditing) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue