Fix bug where dropdowns would not dismiss properly
This commit is contained in:
parent
c18285cec0
commit
f0608878ce
|
@ -29,7 +29,7 @@
|
||||||
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(username));
|
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(username));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dismissDropdown();
|
this.dismissDropdown(!dataValueSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
|
|
|
@ -34,16 +34,19 @@
|
||||||
|
|
||||||
itemClicked(e) {
|
itemClicked(e) {
|
||||||
const selected = e.detail.selected;
|
const selected = e.detail.selected;
|
||||||
if (!selected.hasAttribute('data-value')) {
|
|
||||||
|
if (selected.hasAttribute('data-value')) {
|
||||||
|
this.dismissDropdown();
|
||||||
|
} else {
|
||||||
const token = selected.querySelector('.js-filter-hint').innerText.trim();
|
const token = selected.querySelector('.js-filter-hint').innerText.trim();
|
||||||
const tag = selected.querySelector('.js-filter-tag').innerText.trim();
|
const tag = selected.querySelector('.js-filter-tag').innerText.trim();
|
||||||
|
|
||||||
if (tag.length) {
|
if (tag.length) {
|
||||||
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(token));
|
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(token));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.dismissDropdown();
|
this.dismissDropdown();
|
||||||
|
this.dispatchInputEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
gl.FilteredSearchManager.addWordToInput(labelName);
|
gl.FilteredSearchManager.addWordToInput(labelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dismissDropdown();
|
// debugger
|
||||||
|
this.dismissDropdown(!dataValueSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(milestoneName));
|
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(milestoneName));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dismissDropdown();
|
this.dismissDropdown(!dataValueSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
|
|
|
@ -77,7 +77,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
dismissDropdown() {
|
dismissDropdown() {
|
||||||
|
this.getCurrentHook().list.hide();
|
||||||
this.input.focus();
|
this.input.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatchInputEvent() {
|
||||||
// Propogate input change to FilteredSearchManager
|
// Propogate input change to FilteredSearchManager
|
||||||
// so that it can determine which dropdowns to open
|
// so that it can determine which dropdowns to open
|
||||||
this.input.dispatchEvent(new Event('input'));
|
this.input.dispatchEvent(new Event('input'));
|
||||||
|
@ -91,7 +95,6 @@
|
||||||
if (firstTimeInitialized || forceRenderContent) {
|
if (firstTimeInitialized || forceRenderContent) {
|
||||||
this.renderContent();
|
this.renderContent();
|
||||||
} else if(this.getCurrentHook().list.list.id !== this.listId) {
|
} else if(this.getCurrentHook().list.list.id !== this.listId) {
|
||||||
// this.droplab.changeHookList(this.hookId, `#${this.listId}`);
|
|
||||||
this.renderContent();
|
this.renderContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue