mirror of
https://github.com/zotero/zotero.git
synced 2026-09-27 01:21:27 +00:00
Fix picking a type for the creator removes the entry. Close #5396
This commit is contained in:
parent
162fb4d51b
commit
2d4a086819
1 changed files with 4 additions and 3 deletions
|
|
@ -1119,7 +1119,8 @@
|
|||
rowLabel.appendChild(labelWrapper);
|
||||
let label = this.createLabelElement({
|
||||
id: 'creator-type-label-inner',
|
||||
text: Zotero.getString('creatorTypes.' + Zotero.CreatorTypes.getName(typeID))
|
||||
text: Zotero.getString('creatorTypes.' + Zotero.CreatorTypes.getName(typeID)),
|
||||
skipEventHandlers: true,
|
||||
});
|
||||
labelWrapper.appendChild(label);
|
||||
|
||||
|
|
@ -1562,7 +1563,7 @@
|
|||
return openLink;
|
||||
}
|
||||
|
||||
createLabelElement({ text, id, attributes, classList }) {
|
||||
createLabelElement({ text, id, attributes, classList, skipEventHandlers = false } = {}) {
|
||||
let label = document.createElement('label');
|
||||
label.classList.add('key', ...classList || []);
|
||||
if (text) label.textContent = text;
|
||||
|
|
@ -1573,7 +1574,7 @@
|
|||
}
|
||||
}
|
||||
// On click of the label, toggle the focus of the value field
|
||||
if (this.editable) {
|
||||
if (this.editable && !skipEventHandlers) {
|
||||
label.addEventListener('mousedown', (event) => {
|
||||
// Prevent default focus/blur behavior - we implement our own below
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue