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(Trigger): 修复当body存在zoom并且弹出层位于视图右侧边界时,弹出层向左偏移 #2166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MoNorth
Copy link

@MoNorth MoNorth commented Aug 21, 2023

Types of changes

  • New feature
  • Bug fix
  • Enhancement
  • Documentation change
  • Coding style change
  • Component style change
  • Refactoring
  • Test cases
  • Continuous integration
  • Typescript definition change
  • Breaking change
  • Others

Background and context

Solution

How is the change tested?

Changelog

Component Changelog(CN) Changelog(EN) Related issues

Checklist:

  • Test suite passes (npm run test)
  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others should be submitted to main branch)

Other information

@github-actions
Copy link

Prepare preview

@MoNorth
Copy link
Author

MoNorth commented Aug 21, 2023

#1651

@yinkaihui yinkaihui closed this Aug 25, 2023
@yinkaihui yinkaihui reopened this Aug 25, 2023
const windowHeight = document.documentElement?.clientHeight || window.innerHeight;
const windowWidth = document.documentElement?.clientWidth || window.innerWidth;
const windowHeight = document.documentElement?.clientHeight / bodyZoom || window.innerHeight;
const windowWidth = document.documentElement?.clientWidth / bodyZoom || window.innerWidth;

Copy link
Contributor

Choose a reason for hiding this comment

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

不需要计算 zoom 的值,直接通过 document.documentElement.getboundingdocument.documentElement.getBoundingClientRect 获取宽度高度即可? getBoundingClientRect 返回的尺寸就是 zoom 后的尺寸

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.

None yet

2 participants