properly store width (#3400)

This commit is contained in:
Paulus Schoutsen 2019-07-21 09:54:12 -07:00 committed by GitHub
parent dcb975c8ce
commit 5ec58a723e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,13 +80,19 @@ class StepFlowPickHandler extends LitElement {
`;
}
protected updated(changedProps) {
super.updated(changedProps);
// Store the width so that when we search, box doesn't jump
if (!this._width) {
const width = this.shadowRoot!.querySelector("div")!.clientWidth;
if (width) {
this._width = width;
}
}
}
private async _filterChanged(e) {
this.filter = e.detail.value;
// Store the width so that when we search, box doesn't jump
if (this._width === undefined) {
this._width = this.shadowRoot!.querySelector("div")!.clientWidth;
}
}
private async _handlerPicked(ev) {