Fix query database drop-down rendering location after resize (#16567)

* Fix query database drop-down rendering location after resize

* Revert "Fix query database drop-down rendering location after resize"

This reverts commit 62481a93e696d4fa79ce40ecef3a2567a65dd20c.

* Fixes drop down list rendering issues by closing the list on window
resize

* comment providing the explanation for new listener and checks if list is visible before hiding
This commit is contained in:
lewis-sanchez
2021-08-06 12:51:10 -07:00
committed by GitHub
parent 63c461dca8
commit 310d651df8

View File

@@ -136,6 +136,16 @@ export class Dropdown extends Disposable implements IListVirtualDelegate<string>
}
});
/*
This event listener is intended to close the expanded drop down when the ADS shell window is resized
to prevent the list from rendering incorrectly at the top left corner of the window.
*/
this._register(DOM.addDisposableListener(window, DOM.EventType.RESIZE, () => {
if (this._isDropDownVisible) {
this._hideList();
}
}));
this._register(DOM.addStandardDisposableListener(this._input.inputElement, DOM.EventType.KEY_DOWN, (e: StandardKeyboardEvent) => {
switch (e.keyCode) {
case KeyCode.Enter: