File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1234,15 +1234,26 @@ class CommentPopup {
12341234 if ( ! correctPosition ) {
12351235 this . #editor. commentPopupPosition = [ x , y ] ;
12361236 } else {
1237- const widthRatio =
1238- this . _popupWidth / this . #editor . parentBoundingClientRect . width ;
1237+ const parentRect = this . #editor . parentBoundingClientRect ;
1238+ const widthRatio = this . _popupWidth / parentRect . width ;
12391239 if (
12401240 ( this . #isLTR && x + widthRatio > 1 ) ||
12411241 ( ! this . #isLTR && x - widthRatio >= 0 )
12421242 ) {
12431243 const buttonWidth = this . #editor. commentButtonWidth ;
12441244 x -= widthRatio - buttonWidth ;
12451245 }
1246+ const margin = 0.01 ;
1247+ if ( this . #isLTR) {
1248+ x = Math . max ( x , - parentRect . x / parentRect . width + margin ) ;
1249+ } else {
1250+ x = Math . min (
1251+ x ,
1252+ ( window . innerWidth - parentRect . x ) / parentRect . width -
1253+ widthRatio -
1254+ margin
1255+ ) ;
1256+ }
12461257 }
12471258 this . #posX = x ;
12481259 this . #posY = y ;
You can’t perform that action at this time.
0 commit comments