fix #2173 AutoScrollEditorIntoView doesn't work for search
This commit is contained in:
parent
54e022fab2
commit
6e9ce4dbc8
2 changed files with 7 additions and 1 deletions
|
|
@ -2553,7 +2553,9 @@ var Editor = function(renderer, session) {
|
|||
rect = self.renderer.container.getBoundingClientRect();
|
||||
});
|
||||
var onAfterRender = this.renderer.on("afterRender", function() {
|
||||
if (shouldScroll && rect && self.isFocused()) {
|
||||
if (shouldScroll && rect && (self.isFocused()
|
||||
|| self.searchBox && self.searchBox.isFocused())
|
||||
) {
|
||||
var renderer = self.renderer;
|
||||
var pos = renderer.$cursorLayer.$pixelPos;
|
||||
var config = renderer.layerConfig;
|
||||
|
|
|
|||
|
|
@ -281,6 +281,10 @@ var SearchBox = function(editor, range, showReplaceForm) {
|
|||
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
|
||||
};
|
||||
|
||||
this.isFocused = function() {
|
||||
var el = document.activeElement;
|
||||
return el == this.searchInput || el == this.replaceInput;
|
||||
}
|
||||
}).call(SearchBox.prototype);
|
||||
|
||||
exports.SearchBox = SearchBox;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue