Monaco-editor: Find/Replace widget position

Created on 16 Nov 2017  路  7Comments  路  Source: microsoft/monaco-editor

monaco-editor version: 0.10.0
Browser: Chrome
OS: MacOX

When Find/Replace widget is opened, all lines move down and empty space appears at the top of the editor.
I don't find any option which allow to fix lines and don't move them down. I looked at EditorFindOptions and OverlayWidget interfaces. I also tried "fixedOverflowWidgets" editor option, but it did not help me.

I think it would be nice to have such option.

*question

All 7 comments

I can reproduce it on the playground, and it looks like a bug to me. It happens if the editor is scrollable.

Reproduce:

  • Have enough text to scroll
  • Open find widget (e.g. CMD+F)
  • Scroll down a bit, than scroll back up. Notice that a gap at the top was created that only disappears if you close the find widget.

find offset

Also reproduced when there is no scroll. The same steps on playground:

monaco-editor-find-widget

Actually, this is probably a feature rather than a bug, to have the user see highlighted search results that would otherwise be hidden underneath the widget. I would still be interested to know if this feature can be turned off somehow...

Yes, it seems like a feature and usually it's very useful, but it would be nice to have ability to control this behavior.

Any solution/work-around about this?

Any updates on this?

We now have an option for this. You can use monaco.editor.create(..., { find: { addExtraSpaceOnTop: false } }).

Was this page helpful?
0 / 5 - 0 ratings