Skip to content

fix(super-editor): flip toolbar tooltip below the trigger when it clips the viewport top - #1

Closed
hitpopdimestop wants to merge 3 commits into
mainfrom
fix/3786-toolbar-tooltip-clipping
Closed

fix(super-editor): flip toolbar tooltip below the trigger when it clips the viewport top#1
hitpopdimestop wants to merge 3 commits into
mainfrom
fix/3786-toolbar-tooltip-clipping

Conversation

@hitpopdimestop

@hitpopdimestop hitpopdimestop commented Jul 21, 2026

Copy link
Copy Markdown
Owner

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 - 10 went negative and rendered above the viewport edge (issue superdoc#3786).

It now:

  • flips below the trigger (arrow pointing up, transition origin adjusted) when there is no room above, and
  • clamps horizontally to document.documentElement.clientWidth, which excludes the window scrollbar.

Screenshots

Before — the "Insert table" tooltip is clipped at the window top:
Знімок екрана 2026-07-21 о 14 59 10

After — the tooltip flips below the button:
Знімок екрана 2026-07-21 о 14 59 22

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 a clientWidth < innerWidth horizontal-clamp test.
  • Toolbar test suite passing; Prettier clean. (Note: the repo's ESLint config ignores .vue and test files, so lint does not cover the changed files.)

Fixes superdoc#3786

…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
hitpopdimestop force-pushed the fix/3786-toolbar-tooltip-clipping branch from 4fa59fb to 6297f71 Compare July 21, 2026 11:52
@hitpopdimestop hitpopdimestop changed the title fix(super-editor): keep toolbar tooltips and context menu on-screen near viewport edges fix(super-editor): flip toolbar tooltip below the trigger when it clips the viewport top Jul 21, 2026
@hitpopdimestop
hitpopdimestop force-pushed the fix/3786-toolbar-tooltip-clipping branch from 6297f71 to 9a185a8 Compare July 21, 2026 12:01
@hitpopdimestop

Copy link
Copy Markdown
Owner Author

Superseded by the upstream PR superdoc#3838.

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

Successfully merging this pull request may close these issues.

Toolbar tooltips are cut off by edge of the window

1 participant