@@ -42,6 +42,10 @@ export const POPOVER_STYLES = {
4242 ...base ,
4343 rx : 6 ,
4444 } ) ,
45+ clickArea : ( base : object ) => ( {
46+ ...base ,
47+ pointerEvents : "none" as const ,
48+ } ) ,
4549 highlightedArea : (
4650 base : object ,
4751 state ?: { width ?: number ; height ?: number } ,
@@ -86,20 +90,30 @@ export function computeDefaultPopoverPosition(
8690 props : PositionProps ,
8791) : ResolvedPosition {
8892 const targetHeight = props . bottom - props . top ;
93+ const isTallStrip = targetHeight > props . windowHeight * 0.5 ;
94+ const margin = 16 ;
8995
90- const isFullHeightRightStrip =
91- props . right >= props . windowWidth - 4 &&
92- targetHeight > props . windowHeight * 0.5 ;
93-
94- if ( isFullHeightRightStrip ) {
96+ // Right-anchored full-height strip (e.g. right sidebar): place popover to
97+ // its LEFT. Reactour's "left" fallback can swap to "top"/"bottom" for tall
98+ // targets, so we return explicit coords.
99+ if ( isTallStrip && props . right >= props . windowWidth - 4 ) {
95100 const popoverWidth = props . width || 380 ;
96- const margin = 16 ;
97101 return [
98102 Math . max ( margin , props . left - popoverWidth - margin ) ,
99103 Math . max ( props . top + margin , 64 ) ,
100104 ] ;
101105 }
102106
107+ // Left-anchored full-height strip (e.g. left dock): place popover to its
108+ // RIGHT. Same reason — reactour's "right" fallback drops to "top" for tall
109+ // targets even when there's plenty of room horizontally. We test the
110+ // target's right edge against the viewport midline rather than its left
111+ // edge against zero, so a dock that isn't flush to the window edge still
112+ // qualifies.
113+ if ( isTallStrip && props . right < props . windowWidth * 0.5 ) {
114+ return [ props . right + margin , Math . max ( props . top + margin , 64 ) ] ;
115+ }
116+
103117 return "bottom" ;
104118}
105119
0 commit comments