Inline editor changes the size randomly on typing

I encountered this issue a few weeks ago, when tried to embed nested inline-editor with no defined height (i.e. .cm-editor {height: auto}). Here is an example

ezgif.com-video-to-gif-11

While typing/erasing a new character from the end it changes size randomly, but if there is one left it stays stable.

I tracked DOM changes and did not find any odd activity. Looks like it is enough to toggle (on and off) any class inside cm-scroller to stabilize the size of an editor.

Applying overflow: overlay also did not help.

If the text field was pre-rendered (no changes from the user happened) it always renders correctly.

A sandbox example, that can reproduce it is here.

Thanks

I am not seeing this happen in Firefox or Chrome (Linux).

Confirmed.
Looks like it is a problem of Safari Version 15.6.1 (17613.3.9.1.16)

I’m able to reproduce it in Safari, but only if it is set to always showing scrollbars. I think most have it set to only show the scrollbars when scrolling, with a trackpad. I’ve observed that a lot of websites don’t look good when the option is set like this.

height: 45px fixes it for me, but makes it look different. Just an example.

Making it always show the scrollbar seems to be a workaround. I tried making the scrollbar smaller and it disappears for me, too.

1 Like

Thank you @benatkin, I tried my best and just nothing was willing to work. Cool :wink:
I have finally uploaded all experiments with nested editors to a package and will try to apply your trick on this.