我无法让移动设备上的IOS键盘在焦点上打开。任何建议的解决方案或解决方法?我摆弄了autoFocus属性,但它不会打开键盘。目前的代码:
class Input extends React.Component {
muiTextFieldRef = null;
get inputNode() {
if (!this.muiTextFieldRef) {
return null;
}
return this.muiTextFieldRef.getInputNode();
}
componentDidMount() {
if(this.inputNode) {
this.inputNode.focus();
}
}
render() {
return (
<TextField
ref={(muiTextFieldRef) => {
this.muiTextFieldRef = muiTextFieldRef;
}}
/>
);
}
}