File tree Expand file tree Collapse file tree
webapp/components/general Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,12 +41,14 @@ const TutorialBubble = ({
4141 const windowHeight = window . innerHeight ;
4242 const windowWidth = window . innerWidth ;
4343
44- let x = rect1 . left + ( rect1 . width / 2 ) - ( width2 / 2 ) ;
45- let y = ( rect1 . top - windowHeight ) + rect1 . height ;
44+ // let x = rect1.left + (rect1.width / 2) - (width2 / 2); // bubble is aligned with center of the rectangle
45+ let x = rect1 . left ; // bubble is aligned with the left of the rectangle
46+ let y = ( rect1 . top - windowHeight ) + rect1 . height + rectMargin ;
4647
4748 // Check if element2 is outside the viewport horizontally
4849 if ( x + width2 > windowWidth ) {
49- x = rect1 . left - width2 ;
50+ // x = rect1.left - width2;
51+ x = rect1 . left - ( ( x + width2 ) - windowWidth + rectMargin ) ;
5052 }
5153
5254 if ( x < 0 ) {
@@ -141,7 +143,7 @@ const TutorialBubble = ({
141143 }
142144
143145 const targetRect = DOMtarget . getBoundingClientRect ( ) ;
144- const { x, y } = calculateVisiblePosition ( targetRect , 150 , 300 ) ;
146+ const { x, y } = calculateVisiblePosition ( targetRect , 400 , 184 ) ;
145147
146148 const hasOtherSteps = requestedTourStep < steps . length ;
147149 const nextIsVisible = nextDOMtarget ?. checkVisibility ( ) ;
You can’t perform that action at this time.
0 commit comments