mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fix dropdowns flickering every other time they're opened. The hide message code was being invoked which called hideContextView (the actual dropdown part) even if no message was ever displayed. Now we'll delay setting the message to null and only call hideContextView if we actually had a message to display. (#4528)
Also fixed small issue where messages that didn't have a container would throw an error when trying to call removeClass (since this.element is pulled from the container and thus was undefined. Tested that the flicker is gone and that messages still show up correctly
This commit is contained in:
@@ -154,11 +154,13 @@ export class SelectBox extends vsSelectBox {
|
||||
public showMessage(message: IMessage): void {
|
||||
this.message = message;
|
||||
|
||||
if (this.element) {
|
||||
dom.removeClass(this.element, 'idle');
|
||||
dom.removeClass(this.element, 'info');
|
||||
dom.removeClass(this.element, 'warning');
|
||||
dom.removeClass(this.element, 'error');
|
||||
dom.addClass(this.element, this.classForType(message.type));
|
||||
}
|
||||
|
||||
// ARIA Support
|
||||
let alertText: string;
|
||||
@@ -213,8 +215,6 @@ export class SelectBox extends vsSelectBox {
|
||||
}
|
||||
|
||||
public hideMessage(): void {
|
||||
this.message = null;
|
||||
|
||||
dom.removeClass(this.element, 'info');
|
||||
dom.removeClass(this.element, 'warning');
|
||||
dom.removeClass(this.element, 'error');
|
||||
@@ -222,10 +222,12 @@ export class SelectBox extends vsSelectBox {
|
||||
|
||||
this._hideMessage();
|
||||
this.applyStyles();
|
||||
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
private _hideMessage(): void {
|
||||
if (this.contextViewProvider) {
|
||||
if (this.message && this.contextViewProvider) {
|
||||
this.contextViewProvider.hideContextView();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user