From f7be3a3415c9f988f3db4dcad26b3f0cddc66bba Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 25 Jun 2021 10:36:35 +0300 Subject: [PATCH] Fixed #2142 - When clicking on the target element to open the confirmPopup, the browser's scroll moves --- src/components/confirmpopup/ConfirmPopup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/confirmpopup/ConfirmPopup.js b/src/components/confirmpopup/ConfirmPopup.js index defdb371fe..8fac86666c 100644 --- a/src/components/confirmpopup/ConfirmPopup.js +++ b/src/components/confirmpopup/ConfirmPopup.js @@ -108,6 +108,7 @@ export class ConfirmPopup extends Component { this.onExited = this.onExited.bind(this); this.overlayRef = React.createRef(); + this.acceptBtnRef = React.createRef(); } acceptLabel() { @@ -243,6 +244,10 @@ export class ConfirmPopup extends Component { this.bindScrollListener(); this.bindResizeListener(); + if (this.acceptBtnRef && this.acceptBtnRef.current) { + this.acceptBtnRef.current.focus(); + } + this.props.onShow && this.props.onShow(); } @@ -324,7 +329,7 @@ export class ConfirmPopup extends Component { const content = (
)