Skip to content

Smart search field: resize with the viewport

Warren Gifford requested to merge lg/monaco-resize into master

Created by: lguychard

Fixes #7692 (closed)

The Monaco editor doesn't automatically resize with its container, so explicitly calling editor.layout() is necessary.

This is problematic when parents of the smart search field are flex items, as flex items don't shrink past their content's width, unless they explicitly have a 0 min width - and the Monaco editor's width will only be adjusted as a result of calling editor.layout(), if its container has shrunk.

In addition to fixing resize observer logic, this introduces a flex-shrink-past-contents utility class, applied to parents of the smart search field, that sets a min width of 0 and flex-shrink: 1.

Merge request reports

Loading