Skip to content

Commit

Permalink
Merge pull request #894 from thundersdata-frontend/rn-issue
Browse files Browse the repository at this point in the history
fix: 修复Input组件无法输入中文的bug
  • Loading branch information
chj-damon authored Sep 2, 2024
2 parents 2c649b5 + e8e9632 commit 36b8489
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-crews-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@td-design/react-native': patch
---

fix: 修复Input组件无法输入中文的bug
7 changes: 2 additions & 5 deletions packages/react-native/src/input/useInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ export default function useInput({
}, [value, defaultValue]);

const handleChange = (val: string) => {
if (onChange) {
onChange(val);
} else {
setInputValue(val);
}
setInputValue(val);
onChange?.(val);
};

const handleInputClear = () => {
Expand Down
7 changes: 2 additions & 5 deletions packages/react-native/src/input/useInputItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ export default function useInputItem({
}, [value, defaultValue]);

const handleChange = (val: string) => {
if (onChange) {
onChange(val);
} else {
setInputValue(val);
}
setInputValue(val);
onChange?.(val);
};

const handleInputClear = () => {
Expand Down
7 changes: 2 additions & 5 deletions packages/react-native/src/input/useTextArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ export default function useTextArea({ value, onChange }: Pick<TextAreaProps, 'va
const [inputValue, setInputValue] = useSafeState(value);

const handleChange = (val: string) => {
if (onChange) {
onChange(val);
} else {
setInputValue(val);
}
setInputValue(val);
onChange?.(val);
};

return {
Expand Down

0 comments on commit 36b8489

Please sign in to comment.