[BUG] Highlight and toolbar positioned wrong on outside scroll
Question
Are you using the latest release (older versions are NOT supported)? Yes Are you facing the bug with your local copy of GrapesJS or with the current demo? Local
- OS: Archlinux
- Browser: Firefox 74.0 and Firefox developer edition 75.0b11
- Grapes: v0.16.3
What is the expected behavior?
- Highlight should update its position when the outside scrolls
What happens instead?

I did my best to try and replicate this behaviour, but couldn't. Even using the same stack (parcel, typescript, react, ant design) it seemed to work. So I would like some insight as to how I can debug this.
Looking at the events in inspector, the scroll event is there.
In my replication attempt (https://github.com/tomaskallup/grapesjs-react-scroll-issues) about the same styles should be applied (there is a flexbox which has scrolling content), but the issue isn't present there. (UPDATE Repo has been updated, issue is now present there, see https://github.com/artf/grapesjs/issues/2722#issuecomment-617154850)
If I switch the editor to fullscreen, it works perfectly.
Answers (3)
Yeah really weird, my first guess was that canvas toolbars weren't updating on the window scroll, so I've tried to create a non-fullscreen example with a long page but I've realized that there is no scroll listener (on the main window) because is not necessary, toolbars are positioned correctly without that listener.
So, the only reasonable problems I can think about might be the Firefox browser (so try to see your page in Chrome, please) or maybe you're loading your page inside an iframe because that might be an issue, in that case, you would need to set up a scroll listener and propagate it to the editor
Hi, thanks for the reply!
Firefox doesn't seem to be the issue here (same behaviour in Chrome)
Also the replication repo works in both browsers without the bug.
I'm not loading anything in iframe (this is inspector layout from the actual page)
Only custom styles applied to the upper elements are some margins, paddings, min-height and max-width. Looking at it, the content seems pretty much same as in the replication repository, so I'm just getting more and more confused.
One thing I noticed, it "fixes" itself when resizing window (untill you scroll again)
@artf I think I found the cause, our root element <div id="❤"> has this style:
#❤ {
height: 100vh;
display: flex;
}
Adding that to the reproduction repo caused the issue to appear! (Removing the flex seems to fix the issue, I'll investigate if we really need it in our case, but atleast now there's actual reproduction)
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2469
[BUG] Adding buttons to RTE toolbar in React App causes buttons to be duplicated.
Are you using the latest release (older versions are NOT supported)? YES, 0.15.9Are you facing the bug with your local copy of GrapesJS or...
Issue #1941
[BUG]: When dragging a block over the canvas, JS in script, is appended in canvas before dropping the block.
You're submitting a BUG Are you using the latest release (older versions are NOT supported)? v0.14.57 Are you facing the bug with your loca...
Issue #2683
[BUG] When cancel Colorpicker, it set wrong value for component
Are you using the latest release (older versions are NOT supported)? Yes.Are you facing the bug with your local copy of GrapesJS or with th...
Issue #2275
[BUG] Default styling not being applied when default panels are instantiated
It seems that when the default panels is altered in the config, the basic styles are stripped from the panels. For example the font and scr...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.