Fix an horizontal scrollbar being triggered by Visual Debugger

Created on 21 June 2024, 6 months ago

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.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇷Brazil mabho Rio de Janeiro, RJ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024