fix(super-editor): flip toolbar tooltip below the trigger when it clips the viewport top - #1
Closed
hitpopdimestop wants to merge 3 commits into
Closed
fix(super-editor): flip toolbar tooltip below the trigger when it clips the viewport top#1hitpopdimestop wants to merge 3 commits into
hitpopdimestop wants to merge 3 commits into
Conversation
…he viewport top Tooltips were always positioned above the trigger, so buttons in a toolbar flush with the window top rendered tooltips off-screen (negative top). Flip the tooltip below the trigger (with the arrow pointing up) when there is no room above. Fixes superdoc-dev#3786
…idth Use document.documentElement.clientWidth instead of window.innerWidth so a tooltip near the right edge does not clamp under a window scrollbar.
hitpopdimestop
force-pushed
the
fix/3786-toolbar-tooltip-clipping
branch
from
July 21, 2026 11:52
4fa59fb to
6297f71
Compare
hitpopdimestop
force-pushed
the
fix/3786-toolbar-tooltip-clipping
branch
from
July 21, 2026 12:01
6297f71 to
9a185a8
Compare
Owner
Author
|
Superseded by the upstream PR superdoc#3838. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Toolbar tooltips were clipped when the toolbar sits flush with the window top. The tooltip was always placed above the trigger, so
triggerRect.top - contentHeight - 10went negative and rendered above the viewport edge (issue superdoc#3786).It now:
document.documentElement.clientWidth, which excludes the window scrollbar.Screenshots
Before — the "Insert table" tooltip is clipped at the window top:

After — the tooltip flips below the button:

Test plan
SdTooltip.test.js: flip-below, stay-above, a realistic-height flip (proves the tooltip's height is used, not just when the trigger touches the top), and aclientWidth < innerWidthhorizontal-clamp test..vueand test files, so lint does not cover the changed files.)Fixes superdoc#3786