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: correct the offset of the mirror #455

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zjffun
Copy link
Contributor

@zjffun zjffun commented Oct 30, 2020

This PR implements or fixes... (explain your changes)

Fix the offset of the mirror and the set value for the mirror display.

Reproduction: https://codepen.io/1010543618/pen/PozRmve

See:

This PR closes the following issues... (if applicable)

#139

Does this PR require the Docs to be updated?

No

Does this PR require new tests?

Because the jsdom used by jest by default is not a real browser environment, it is difficult to write tests.

This branch been tested on... (click all that apply / add new items)

Browsers:

  • Chrome version
  • Firefox version
  • Safari version
  • IE / Edge version
  • iOS Browser version
  • Android Browser version

@@ -426,7 +474,7 @@ function resetMirror({mirror, source, options, ...args}) {
offsetWidth = computedSourceStyles.getPropertyValue('width');
}

mirror.style.display = null;
mirror.style.display = '';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A style declaration is reset by setting it to null or an empty string, e.g., elt.style.color = null. Internet Explorer requires setting it to an empty string, and does not do anything when setting it to null.

@zjffun
Copy link
Contributor Author

zjffun commented Oct 30, 2020

if (
(containerStyle.transform && containerStyle.transform !== 'none') ||
(containerStyle.perspective && containerStyle.perspective !== 'none') ||
(containerStyle.filter && containerStyle.filter !== 'none')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(containerStyle.backdropFilter && containerStyle.backdropFilter !== 'none')

#517

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.

1 participant