Issue #2906šŸ’¬ AnsweredOpened July 21, 2020by neon123450 reactions

Editor.refresh() not working in custom setup

Quick answerby artf

@nedim1511 can you please provide a reproducible demo, please?

Read full answer below ↓

Question

I have a problem with a custom setup where the canvas iframe is moved around with js. The "editor.refresh()" call does not fix the positioning of the tools after the move.

I think the problem is due to the offset cache not cleared on refresh.

If I call this before refresh, the tools are positioned as expected:

                editor.trigger('test:canvasOffset');
                editor.trigger('frame:updated');

Version: 0.16.18

Answers (3)

artf• August 3, 2020

@nedim1511 can you please provide a reproducible demo, please?

neon12345• August 3, 2020

https://jsfiddle.net/3gqh6p5a/

Click select the "Hello World" and drag the vertical splitter to the left to resize the split window. The "editor.refresh()" called on dragEnd should align the tools but it does not seem to work.

It is more obvious on horizontal drag resize.

artf• August 26, 2020

On my local copy, your example works correctly so probably in the next release it will be fixed

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.