Problem/Motivation
Under given circumtances, Visual Debugger might trigger an horizontal scroll on the page when one of the elements within wrapper element .visual-debugger--base is wider than the screen size. A 1px difference might trigger the scrollbar. An element covering the entire screen might cause the scrollbar to be activated.
Steps to reproduce
Install Visual Debugger on a fresh Drupal 10 site with the Olivero theme. Element off_canvas_page_wrapper may cause the horizontal scrollbar to be displayed because of a 1px difference.
Proposed resolution
When calculating instance widths, use Math.floor (always rounds down and returns the largest integer less than or equal to a given number), instead of Math.round (might deliver an integer which is larger than the element itself, which could cause an element to be wider than the visible screen width).
Remaining tasks
Fix the code and replace the math rounding method.
User interface changes
Should stop the horizontal scrollbar from showing.
Issue fork visual_debugger-3456248
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mabho commentedThe problem with horizontal scrolling has been fixed on this version.
Comment #5
mabho commentedComment #6
mabho commentedThe problem has been fixed and an horizontal scrollbar isn't showing anymore.
Comment #7
mabho commented