Issue #3480💬 AnsweredOpened May 25, 2021by samichamoun1 reactions

How to control the height of the editor dynamically to avoid clunky scrolling

Quick answerby ahmedderkaoui1

try to work with vh instead of px. eg: give the editor height: '80vh', your navbar height: '20vh'. This way, the vertical scroll will never be shown or needed as long as the sum of all elements's vh ≤ 100 Hope this helps.

Read full answer below ↓

Question

I've noticed if in the initialise function I set a height it will set based on a specific pixel amount e.g. height: "500px". However if you try to set with a percentage e.g. height: "90%" the editor has no height at all. Also I'm wondering what is setting the height if nothing is set because it appears to be automatically calculating a pixel amount that consumes the entire page (e.g. 100%). I actually have the editor wrapped inside a standard page template we have in the back-end of our CMS, and this page template actually has more content in side menu bars which forces the page to become a s...

Answers (4)

ahmedderkaouiMay 25, 2021

try to work with vh instead of px.

eg: give the editor height: '80vh', your navbar height: '20vh'. This way, the vertical scroll will never be shown or needed as long as the sum of all elements's vh ≤ 100

Hope this helps.

samichamounMay 25, 2021

try to work with vh instead of px.

eg: give the editor height: '80vh', your navbar height: '20vh'. This way, the vertical scroll will never be shown or needed as long as the sum of all elements's vh ≤ 100

Hope this helps.

thanks this is useful!

artfMay 25, 2021

This is more a layout issue and not related to the GrapesJS editor itself.

GJSBlockMay 17, 2026

Thanks for reporting this, @samichamoun. Great suggestion about How to control the height of the editor dynamically to avoid clunky scrolling! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event system: Alternative approaches: L...

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.