Skip to content

Commit

Permalink
fix: Use overflow clip in tooltip button to prevent scrollbar (#1002)
Browse files Browse the repository at this point in the history
In #994 `overflow-x: hidden` was added to the tooltips to prevent
unwanted overflows. `hidden` on a single axis does however introduce
scrollbars on Windows devices and Mac's who enabled scrollbars to show
always (this is great to emulate how a big part of users see your
website, which is why I have it enabled).

Changing the overflow to `overflow-x: clip` will achieve the same
result, but won't show a scrollbar. Which is what I added in this PR.
See video below showcasing the issue and fix. Let me know your thoughts.

cc @luwes 

Fixes #1000 


https://github.com/user-attachments/assets/67509a11-099f-4b02-ba35-1e0acc46d003
  • Loading branch information
JeroenReumkens authored Oct 8, 2024
1 parent ed9b18a commit d3a8bf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/media-chrome-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ template.innerHTML = /*html*/ `
media-tooltip {
${/** Make sure unpositioned tooltip doesn't cause page overflow (scroll). */ ''}
max-width: 0;
overflow-x: hidden;
overflow-x: clip;
opacity: 0;
transition: opacity .3s, max-width 0s 9s;
}
Expand Down

0 comments on commit d3a8bf1

Please sign in to comment.