Issue #1865Opened March 6, 2019by Gianglo0 reactions

[Bug]: Grapes change page position

Question

Hello, I found the following problem using grapes inside an html page: when you click on some elements of the editor, such as the arrow to move an element in the label manager, all the page shift up.

The problem is also found in your JSFiddle Starter template https://jsfiddle.net/szLp8h4n.

bug_grapes

Answers (2)

artfMarch 9, 20190 reactions

Ok, we use the scrollIntoView API to center elements in the canvas (when you select the component in Layers) and layers (on component select in canvas) but seems like this bubbles up to the main window. By looking at https://stackoverflow.com/a/52835382 this configuration seems to fix the issue

const editor = grapesjs.init({
	// ...
  	layerManager: {
  		scrollCanvas: { behavior: 'smooth', block: 'nearest' },
    	scrollLayers: { behavior: 'auto', block: 'nearest'},
  	},
});

I'll update the default values in the next release

lock[bot]March 10, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.