You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not a bug report. (please use a different template for reporting a bug)
This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description
This is in reference to the Find/Replace widget:
Ask
We'd like a built-in event listener to hook into that fires when the widget is opened and closed (e.g. onFindWidgetOpen, onFindWidgetClose)
Use case
We have an extra button outside the editor that should be able to open and close the find widget. This button's background will also change depending on whether the widget is open.
We're able to use editor.getAction("actions.find").run(); to open the widget and editor.getContribution("editor.contrib.findController").closeFindWidget(); to close the widget; the problem is that the widget can also be opened and closed from within the Monaco editor itself (opened via ctrl/cmd+F, closed via "X" button, esc key, etc). We need to know when the widget is opened or closed from within the editor so that we can sync the state to our own button and have it fire the correct action. Currently it seems the only solution available is a series of hacky onMouseDown and onKeyDown listeners.
We have tried hooking into editor.getContribution("editor.contrib.findController").getState().onFindReplaceStateChange as well, but the isVisible prop available there did not seem to update accurately.
Thank you!
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
The text was updated successfully, but these errors were encountered:
Context
Description
This is in reference to the Find/Replace widget:
Ask
We'd like a built-in event listener to hook into that fires when the widget is opened and closed (e.g.
onFindWidgetOpen
,onFindWidgetClose
)Use case
We have an extra button outside the editor that should be able to open and close the find widget. This button's background will also change depending on whether the widget is open.
We're able to use
editor.getAction("actions.find").run();
to open the widget andeditor.getContribution("editor.contrib.findController").closeFindWidget();
to close the widget; the problem is that the widget can also be opened and closed from within the Monaco editor itself (opened via ctrl/cmd+F, closed via "X" button, esc key, etc). We need to know when the widget is opened or closed from within the editor so that we can sync the state to our own button and have it fire the correct action. Currently it seems the only solution available is a series of hackyonMouseDown
andonKeyDown
listeners.We have tried hooking into
editor.getContribution("editor.contrib.findController").getState().onFindReplaceStateChange
as well, but theisVisible
prop available there did not seem to update accurately.Thank you!
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
The text was updated successfully, but these errors were encountered: