Ant-design-mobile: Modal renrender cause can not input chinese

Created on 19 Jan 2018  ·  9Comments  ·  Source: ant-design/ant-design-mobile

import { List, InputItem, Modal } from 'antd-mobile';

class Demo extends React.Component {
  state = { nick: '' }
  finishNickModify = nick => {
    this.setState({ nick })
  }
  render() {
    return <Modal visible={true}> <List>
        <InputItem
            onChange={this.finishNickModify}
            value={this.state.nick}
          >昵称</InputItem>
        </List></Modal>
    ;
  }
}

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

Most helpful comment

@basilbai 这是react-native 新版本的BUG 切换到以下对应版本就可以了

dependencies

"react": "16.2.0",
"react-native": "0.53.3",

devDependencies

"react-test-renderer": "16.2.0"

All 9 comments

@paranoidjk 我也碰到了这个问题。在Modal组件上使用InputItem,受控组件,不能输入中文,每输入一个字符,光标自动跑到末尾。请问有解决方案吗?[email protected]

@paranoidjk 2.1.8版本没法重现

Modal.prompt 同样有这个问题 [email protected] IOS

react-native: 0.55.2
antd-mobile: ^2.1.8

系统环境: ios/11.3
没有装第三方输入
调起系统输入法 中文模式下 输入一个字母就马上改变 无法输入中文
不管是Modal的输入 还是直接使用(List > InputItem)都会出现这种情况

@deboyblog 我遇到了和你一样的问题

@basilbai 这是react-native 新版本的BUG 切换到以下对应版本就可以了

dependencies

"react": "16.2.0",
"react-native": "0.53.3",

devDependencies

"react-test-renderer": "16.2.0"

@deboyblog 我尝试一下,感谢你!

@basilbai 更改rn版本之后 记得删除node_modules再安装 否则会出现一些莫名其妙的错误

"react": "16.8.3",
"react-native": "0.59.9",

这两个版本 也有同样的问题 有解决办法没

Was this page helpful?
0 / 5 - 0 ratings