-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with field focus inside modal of ant-design #279
Comments
Please share the whole example with both schema and |
Oh I use this form in <Modal
title="Payment"
key={this.state.modalKey}
visible={this.state.visibleModal}
onCancel={this.handleModalCancel}
footer={null}
>
<OrderPayment order={order} handleModalCancel={this.handleModalCancel} />
</Modal>
--------------
export default class OrderPayment extends Component {
componentDidMount() {
this.balanceRef.focus();
};
render(){
return(
..........
<AutoField name="balance" inputRef={ref => this.balanceRef = ref}/>
);
} |
Ok so generally it is a problem of componentDidMount () {
setTimeout(() => this.balanceRef.focus(), 0)
} Checked it myself and it is working, let me know if it does for you, so far i am closing, |
inputRef
very thanks 👍 |
Get error
The text was updated successfully, but these errors were encountered: