VanessaGiannoni commented on code in PR #37022:
URL: https://github.com/apache/superset/pull/37022#discussion_r2714339257


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/tooltip.ts:
##########
@@ -47,20 +53,38 @@ export function getDefaultTooltip(refs: Refs) {
       const divRect = refs.divRef?.current?.getBoundingClientRect();
 
       // The mouse coordinates relative to the whole window
-      // The first parameter to the position function is the mouse position 
relative to the canvas
       const mouseX = canvasMousePos[0] + (divRect?.x || 0);
       const mouseY = canvasMousePos[1] + (divRect?.y || 0);
 
+      // Available viewport dimensions
+      const viewportWidth = document.documentElement.clientWidth;
+      const viewportHeight = document.documentElement.clientHeight;
+
       // The width and height of the tooltip dom element
       const tooltipWidth = sizes.contentSize[0];
       const tooltipHeight = sizes.contentSize[1];
 
+      // Cap tooltip height to the smaller of 800px or 80vh
+      const maxAllowedHeight = Math.min(800, Math.floor(viewportHeight * 0.8));
+
+      if (tooltipDom) {
+        tooltipDom.style.maxHeight = `${maxAllowedHeight}px`;
+        tooltipDom.style.overflow = 'auto';
+        // mobile momentum scrolling
+        tooltipDom.style.setProperty('-webkit-overflow-scrolling', 'touch');

Review Comment:
   Oh, thanks for letting me know about that. I removed this line then since it 
is not needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to