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: fix toggle position:fixed on bodyElement with other fixed elements. #416

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

andycall
Copy link
Member

@andycall andycall commented Jul 11, 2023

The following codes will throw a layout error when toggle the position: fixed on body element.

<!DOCTYPE html>
<html>
  <head>
    <style>
      .fixed {
        position: fixed;
      }
    </style>
  </head>
  <body>
    <div class="fixed a">
      <img class="logo" src="./webf.png" />
    </div>
    <div class="fixed b">
      <img class="logo" src="./webf.png" />
    </div>
    <div class="fixed c">
      <img class="logo" src="./webf.png" />
    </div>

    <script>
      setTimeout(() => {
        document.body.style.position = 'fixed';
        setTimeout(() => {
          document.body.style.position = '';
        }, 100);
      }, 100);
    </script>
  </body>
</html>

@andycall andycall added this pull request to the merge queue Jul 17, 2023
Merged via the queue into main with commit d04ed82 Jul 17, 2023
@andycall andycall deleted the fix/toggle_fixed_on_body branch July 17, 2023 06:33
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.

3 participants