弹框是应该让之前的按钮失去焦点, 否则按 enter 还会弹出

This commit is contained in:
liaoxuezhi 2019-06-05 16:29:30 +08:00
parent 6db5eb1de9
commit 07437ec5e8
2 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,7 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
};
handleExited = () => {
const onExited = this.props.onExited;
document.activeElement && (document.activeElement as HTMLElement).blur();
onExited && onExited();
setTimeout(() => {
document.querySelector('.amis-dialog-widget') || document.body.classList.remove(`is-modalOpened`);

View File

@ -216,6 +216,7 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
this.setState({
entered: true,
});
document.activeElement && (document.activeElement as HTMLElement).blur();
}
handleExited() {