diff --git a/CHANGELOG.md b/CHANGELOG.md index 141675e75..9bfb6fde6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Position of Sugar Icon in Popup on homescreen is toward bottom right #1662 - Recording video doesn't work on Windows #1203 - Activity Description opening downwards in Journal #1407 +- Listview Popup increasing page length and opening downwards for lower icons #1674 ## [1.8.0] - 2024-04-10 ### Added diff --git a/js/popup.js b/js/popup.js index ab9d01fab..d6913aa44 100644 --- a/js/popup.js +++ b/js/popup.js @@ -95,9 +95,15 @@ enyo.kind({ // Popup will overflow window, prepare to shift menu this.overflowY = true; } + var screenHeight = document.getElementById("canvas").offsetHeight; + var popupTopPosition = mouse.position.y + this.margin.top; + var popupBottomPosition = mouse.position.x + this.margin.left; + if (mouse.position.y + popupSize > screenHeight) { + popupTopPosition = screenHeight+this.margin.top-popupSize; + } this.setStyle("bottom", ""); - this.applyStyle("top", (mouse.position.y+this.margin.top)+"px"); - this.applyStyle("left", (mouse.position.x+this.margin.left)+"px"); + this.applyStyle("top", (popupTopPosition) + "px"); + this.applyStyle("left", (popupBottomPosition) + "px"); this.show(); this.timer = window.setInterval(enyo.bind(this, "showContent"), 0); },