Procházet zdrojové kódy

fix(AdvancedTable): (un)highlightRow rowElement focus and blur not a function

Owen Diffey před 3 roky
rodič
revize
d912bb1732
1 změnil soubory, kde provedl 8 přidání a 2 odebrání
  1. 8 2
      frontend/src/components/AdvancedTable.vue

+ 8 - 2
frontend/src/components/AdvancedTable.vue

@@ -1537,13 +1537,19 @@ export default {
 			// Set the last clicked item to no longer be highlighted, if it exists
 			if (this.lastSelectedItemIndex >= 0)
 				this.rows[this.lastSelectedItemIndex].highlighted = false;
-			if (rowElement) rowElement.focus();
+			if (rowElement)
+				this.$nextTick(() => {
+					rowElement.focus();
+				});
 			// Set the item to be highlighted
 			this.rows[itemIndex].highlighted = true;
 		},
 		unhighlightRow(itemIndex) {
 			const rowElement = this.$refs[`row-${itemIndex}`];
-			if (rowElement) rowElement.blur();
+			if (rowElement)
+				this.$nextTick(() => {
+					rowElement.blur();
+				});
 			// Set the item to no longer be highlighted
 			this.rows[itemIndex].highlighted = false;
 		},