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

Page Layout Shifts Right on Element Deletion in Chromium Browsers #12

Open
BigEyeSmolMouth opened this issue Sep 3, 2024 · 0 comments

Comments

@BigEyeSmolMouth
Copy link

Description

A peculiar layout issue occurs when elements are deleted from the page. The entire page shifts exactly one column to the right, as observed in debug mode. This behaviour is inconsistent and difficult to pinpoint as I don't have enough knowledge of how the recalculation of layout after DOM modifications works with your script:

  • It's not clear which specific tag or part of the JavaScript triggers this recalculation.
  • The shift can occur when deleting various elements, including <figure>, <details>, or even <p> tags, especially on pages with fewer types of different elements.
  • On your homepage, the issue can be consistently reproduced by deleting all elements from top to bottom. The shift typically occurs upon deleting a <figure> element.

This issue appears to be exclusive to Chromium-based browsers. It cannot be reproduced on Safari or Firefox.

Steps to Reproduce

  1. Navigate to https://owickstrom.github.io/the-monospace-web/
  2. Open the browser's developer tools
  3. Begin deleting elements from the DOM, starting with <nav id="TOC" role="doc-toc"></nav>
  4. Continue deleting elements sequentially from top to bottom
  5. Observe the page layout carefully after each deletion
  6. Note when the entire page suddenly shifts one column to the right

Screenshots

Before Element Deletion

Before deletion

After Element Deletion (Note the rightward shift)

After deletion

Environment

Operating System

  • macOS Ventura 13.4.1

Browsers

  • Google Chrome 128.0.6613.114
  • Arc 1.57.1 (52939) - Chromium Engine Version 128.0.6613.85
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

No branches or pull requests

1 participant