Skip to content

Commit

Permalink
feat(Input): add api composition for call onChange after IME finished f…
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon authored and youluna committed Jun 10, 2021
1 parent 1fd9c6a commit baf94db
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rules": {
"header-max-length": [2, "always", 72],
"header-max-length": [2, "always", 90],
"scope-empty": [2, "never"],
"scope-case": [2, "always", "pascal-case"],
"subject-empty": [2, "never"],
Expand Down
40 changes: 40 additions & 0 deletions docs/input/demo/ime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 中文输入法

- order: 12

中文输入完成的时候才会触发 onChange

:::lang=en-us

# ime

- order: 0

trigger onChange after IME finished

:::
---


````jsx
import { Input } from '@alifd/next';

function onChange(v) {
console.log(v);
}

function Demo(props) {
const [value, setValue] = React.useState('');
const handleChange = (value) => {
console.log(value);
setValue(value);
}

return <div>
<Input value={value} onChange={handleChange} composition /> <br/><br/>
<Input.TextArea value={value} onChange={handleChange} composition />
</div>
}

ReactDOM.render(<Demo />, mountNode);
````
Loading

0 comments on commit baf94db

Please sign in to comment.