Skip to content

Commit

Permalink
fix: typed input box's text will not update after you trigger a trans…
Browse files Browse the repository at this point in the history
…late request which is not through typing in input box
  • Loading branch information
chunibyocola committed Jul 29, 2021
1 parent 98835c2 commit 22afdef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/RawText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const RawText: React.FC<RawTextProps> = ({ defaultValue, rawTextTranslate, focus
useEffect(() => {
if (defaultValue) {
lastTextRef.current = defaultValue.trimRight();
textareaEl.current && (textareaEl.current.value = defaultValue);
}
}, [defaultValue]);

Expand Down

0 comments on commit 22afdef

Please sign in to comment.