ant-design/components/input-number/demo/keyboard.md
陈帅 40f9be9417
megre Feature into master (#29141)
* feat: Allow user to configure the Tooltip in the Table header (#29002)

* feat: Table header supports tooltipPlacement

* docs: add Table tooltipPlacement

* feat: Allow user to configure the Tooltip in the Table header

* fix: fix jsx and use old code style

* fix: replace if blocks with ternary operator

* docs: fix url

Co-authored-by: 偏右 <afc163@gmail.com>

* docs: fix url

Co-authored-by: harrisoff <john@smith.kyon>
Co-authored-by: 偏右 <afc163@gmail.com>

* fix: Row with gutter has additional gap (#29059)

* chore: init gutter

* feat: col support gap

* chore: Update playground

* fix: Safari padding

* test: fix test case

* test: More test case

* docs: Update demo

* test: Update coverage

* test: Update test hack

* feat(input-number): add keyboard prop to support disable keyboard (#29110)

Co-authored-by: Ant Design GitHub Bot <yesmeck+ant-design-bot@gmail.com>
Co-authored-by: Harrison <stlebea@foxmail.com>
Co-authored-by: harrisoff <john@smith.kyon>
Co-authored-by: 偏右 <afc163@gmail.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
Co-authored-by: Kermit <kermitlx@outlook.com>
2021-02-01 10:15:39 +08:00

745 B

order title
5
zh-CN en-US
键盘行为 Keyboard

zh-CN

使用 keyboard 属性可以控制键盘行为。

en-US

Control keyboard behavior by keyboard.

import { InputNumber, Button } from 'antd';

class App extends React.Component {
  state = {
    keyboard: true,
  };

  toggle = () => {
    this.setState({
      keyboard: !this.state.keyboard,
    });
  };

  render() {
    return (
      <>
        <InputNumber min={1} max={10} keyboard={this.state.keyboard} defaultValue={3} />
        <div style={{ marginTop: 20 }}>
          <Button onClick={this.toggle} type="primary">
            Toggle keyboard
          </Button>
        </div>
      </>
    );
  }
}

ReactDOM.render(<App />, mountNode);