Clicking filename label should focus/blur field in attachment box
This commit is contained in:
parent
f990cb3f4b
commit
7fe01d6c03
1 changed files with 12 additions and 0 deletions
|
@ -263,6 +263,8 @@
|
|||
reindexButton.click();
|
||||
}
|
||||
});
|
||||
|
||||
this.querySelectorAll(".meta-label").forEach(label => label.addEventListener("click", this._handleMetaLabelClick));
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
@ -622,6 +624,16 @@
|
|||
await this.item.saveTx();
|
||||
}
|
||||
|
||||
_handleMetaLabelClick = (event) => {
|
||||
let labelWrapper = event.target.closest(".meta-label");
|
||||
if (labelWrapper.nextSibling.contains(document.activeElement)) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
else if (!labelWrapper.nextSibling.firstChild.readOnly) {
|
||||
labelWrapper.nextSibling.firstChild.focus();
|
||||
}
|
||||
};
|
||||
|
||||
_id(id) {
|
||||
return this.querySelector(`#${id}`);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue