question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A scrolling container leaves FloatPanels (dropdown menus, toolbars, tooltips) unmoored / positioned incorrectly

See original GitHub issue

This is both a bug report and a feature request.

Currently, if TinyMCE is the child of a container which scrolls, the menus and tooltips become unmoored. For example:

A <div> with height: #px and overflow: autojsbin A <div> with position: fixedjsbin

I expect a mechanism for handling this scenario.

I’ve seen two possible solutions discussed.

Constraining the UI elements to a given container, as described

Monitoring DOM events to hide the pop-over elements when necessary, as described

Neither of these work as expected in fairly common edge cases. For example:

When using the first solution, content loaded into the scrolling container above TinyMCE can cause the FloatPanel position calculations to be incorrect.

When using the second solution, the sudden disapearance of menus may be poor UX. Also, certain overlays require hacks, like tooltips, or are even immune to tinymce.ui.FloatPanel.hideAll(), like the table manipulation toolbar.

I’d like to propose a third solution. Repositioning the overlays when the element they’re supposed to be attached to moves. This desire is inspired by react-popover’s repositioning handling.

I don’t know how viable any proposed solution might be. Currently I’m using the second solution. I do think the options are worth discussing though.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:13
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
AbstractAlaocommented, Aug 19, 2020

I’ve been working hours to try and find the problem here. Seems the editor changes the position based on the scroll and it is way off. Is there a fix for this?

I recently got it working using a combination of the changes suggested here. It seems the main problem is that I had the following in the css

*html {
	max-width:100%;
	overflow-x:hidden;
		overflow-x:auto;
}

After I removed this it started working.

7reactions
Orimaycommented, Apr 2, 2019

It’s still an issue for TinyMCE 5

Read more comments on GitHub >

github_iconTop Results From Across the Web

TinyMCE in position fixed or set height container, floatpanels ...
If TinyMCE is the child of a container which scrolls, the menus and tooltips become unmoored. For example: A <div> with height: #px...
Read more >
tinymce - Bountysource
A scrolling container leaves FloatPanels (dropdown menus, toolbars, ... is the child of a container which scrolls, the menus and tooltips become unmoored....
Read more >
Everything I Know About Positioning Poppers (Tooltips ...
Problem 3: Scrolling containers. Your reference element and popper could be located anywhere in the DOM. For example your reference element and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found