Forráskód Böngészése

Prevented tooltips staying in focus when modal opened from currently playing

Owen Diffey 3 éve
szülő
commit
621628068d

+ 14 - 0
frontend/src/pages/Station/components/CurrentlyPlaying.vue

@@ -59,6 +59,7 @@
 			interactive="true"
 			placement="right"
 			theme="songActions"
+			ref="songActions"
 			trigger="click"
 		>
 			<template #trigger>
@@ -137,11 +138,24 @@ export default {
 		})
 	},
 	methods: {
+		hideTippyElements() {
+			this.$refs.songActions.tip.hide();
+
+			setTimeout(
+				() =>
+					Array.from(
+						document.querySelectorAll(".tippy-popper")
+					).forEach(popper => popper._tippy.hide()),
+				500
+			);
+		},
 		edit(song) {
+			this.hideTippyElements();
 			this.editSong(song);
 			this.openModal({ sector: "admin", modal: "editSong" });
 		},
 		report(song) {
+			this.hideTippyElements();
 			this.reportSong(song);
 			this.openModal({ sector: "station", modal: "report" });
 		},