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

fix: page scroll position will jump after dialog is closed #202

Merged
merged 2 commits into from
Sep 2, 2020

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Sep 2, 2020

@vercel
Copy link

vercel bot commented Sep 2, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/dialog/pzgk4aqxs
✅ Preview: https://dialog-git-fix-modal-jump.react-component.vercel.app

@codecov
Copy link

codecov bot commented Sep 2, 2020

Codecov Report

Merging #202 into master will not change coverage.
The diff coverage is 85.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #202   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files           3        3           
  Lines         189      189           
  Branches       53       53           
=======================================
  Hits          174      174           
  Misses         15       15           
Impacted Files Coverage Δ
src/Dialog.tsx 91.81% <85.71%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d535d7...8259401. Read the comment docs.

@afc163 afc163 merged commit 6a45ccb into master Sep 2, 2020
@afc163 afc163 deleted the fix-modal-jump branch September 2, 2020 14:09
src/Dialog.tsx Show resolved Hide resolved
this.lastOutSideFocusNode = null;
}
this.lastOutSideFocusNode = null;
}
if (afterClose) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

      try {
        this.lastOutSideFocusNode.focus();
      } catch (e) {
--        this.lastOutSideFocusNode = null; // 没看懂这一行的作用
      }
      this.lastOutSideFocusNode = null;// 在这里已经设置了null
    

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

Successfully merging this pull request may close these issues.

Modal close will roll up
2 participants