Browse Source

fix: Bulk actions popup positioned below display view

Owen Diffey 1 year ago
parent
commit
1e3f26e5a1

+ 4 - 3
frontend/src/App.vue

@@ -536,10 +536,8 @@ code {
 }
 
 html {
-	overflow-y: auto !important;
-	overflow-x: hidden;
 	height: 100%;
-	background-color: inherit;
+	overflow: hidden;
 	font-size: 14px;
 }
 
@@ -549,7 +547,10 @@ body {
 	line-height: 1.4285714;
 	font-size: 1rem;
 	font-family: "Inter", Helvetica, Arial, sans-serif;
+	height: 100%;
 	max-width: 100%;
+	overflow-y: auto !important;
+	overflow-x: hidden;
 }
 
 .app {

+ 2 - 2
frontend/src/main.ts

@@ -77,11 +77,11 @@ app.directive("scroll", {
 			clearTimeout(window.scrollDebounceId);
 			window.scrollDebounceId = setTimeout(() => {
 				if (binding.value(evt, el)) {
-					window.removeEventListener("scroll", f);
+					document.body.removeEventListener("scroll", f);
 				}
 			}, 200);
 		};
-		window.addEventListener("scroll", f);
+		document.body.addEventListener("scroll", f);
 	}
 });
 

+ 2 - 2
frontend/src/pages/Admin/index.vue

@@ -123,7 +123,7 @@ onMounted(async () => {
 		sidebarActive.value = !(document.body.clientWidth <= 768);
 
 	calculateSidebarPadding();
-	window.addEventListener("scroll", calculateSidebarPadding);
+	document.body.addEventListener("scroll", calculateSidebarPadding);
 
 	keyboardShortcuts.registerShortcut("admin.toggleKeyboardShortcutsHelper", {
 		keyCode: 191, // '/' key
@@ -148,7 +148,7 @@ onMounted(async () => {
 onBeforeUnmount(() => {
 	socket.dispatch("apis.leaveRooms");
 
-	window.removeEventListener("scroll", calculateSidebarPadding);
+	document.body.removeEventListener("scroll", calculateSidebarPadding);
 
 	const shortcutNames = [
 		"admin.toggleKeyboardShortcutsHelper",

+ 3 - 3
frontend/src/pages/Profile/Tabs/RecentActivity.vue

@@ -61,7 +61,7 @@ const getSet = () => {
 };
 
 const handleScroll = () => {
-	const scrollPosition = window.scrollY + window.innerHeight;
+	const scrollPosition = document.body.scrollTop + document.body.clientHeight;
 	const bottomPosition = document.body.scrollHeight;
 
 	if (scrollPosition + 400 >= bottomPosition) getSet();
@@ -70,7 +70,7 @@ const handleScroll = () => {
 };
 
 onMounted(() => {
-	window.addEventListener("scroll", handleScroll);
+	document.body.addEventListener("scroll", handleScroll);
 
 	socket.onConnect(() => {
 		if (myUserId.value !== props.userId)
@@ -114,7 +114,7 @@ onMounted(() => {
 });
 
 onUnmounted(() => {
-	window.removeEventListener("scroll", handleScroll);
+	document.body.removeEventListener("scroll", handleScroll);
 });
 </script>
 

+ 1 - 1
frontend/src/pages/Station/index.vue

@@ -873,7 +873,7 @@ onMounted(async () => {
 		}
 	});
 
-	window.scrollTo(0, 0);
+	document.body.scrollTo(0, 0);
 
 	stationIdentifier.value = route.params.id;