Skip to content
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

单页面,输入框设为失焦校验,聚焦状态跳转会有问题 #59

Open
m2rbl3 opened this issue Mar 26, 2020 · 0 comments
Open

Comments

@m2rbl3
Copy link

m2rbl3 commented Mar 26, 2020

react-router v4构建的单页面网页,如果在输入框聚焦状态下点击跳转,会因为失焦执行FormItemvalidationData方法,但因为是延迟100ms才执行,此时组件已经销毁,导致报错。

    validationData(id: string) {
        if (this.validationTime) {
            clearTimeout(this.validationTime);
            this.validationTime = null;
        }
        this.validationTime = setTimeout(() => {
            const { formContext } = this.props;
            formContext.validation(id, null);
        }, 100);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant