@@ -69,9 +69,9 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
6969 stopOnOutsideClick = false ,
7070 arrowColor = "#fff" ,
7171 arrowSize = ARROW_SIZE ,
72- margin = MARGIN
72+ margin = MARGIN ,
7373 } ,
74- ref
74+ ref ,
7575 ) {
7676 const { stop, currentStep, visible } = useCopilot ( ) ;
7777 const [ tooltipStyles , setTooltipStyles ] = useState ( { } ) ;
@@ -82,7 +82,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
8282 } ) ;
8383 const layoutRef = useRef ( makeDefaultLayout ( ) ) ;
8484 const [ layout , setLayout ] = useState < LayoutRectangle | undefined > (
85- undefined
85+ undefined ,
8686 ) ;
8787 const [ maskRect , setMaskRect ] = useState < LayoutRectangle | undefined > ( ) ;
8888
@@ -155,20 +155,28 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
155155 const tooltip : ViewStyle = { } ;
156156 const arrow : ViewStyle = { } ;
157157
158+ arrow . position = "absolute" ;
159+
158160 if ( verticalPosition === "bottom" ) {
159161 tooltip . top = rect . y + rect . height + margin ;
160162 arrow . borderBottomColor = arrowColor ;
163+ arrow . borderTopColor = "transparent" ;
164+ arrow . borderLeftColor = "transparent" ;
165+ arrow . borderRightColor = "transparent" ;
161166 arrow . top = tooltip . top - arrowSize * 2 ;
162167 } else {
163168 tooltip . bottom = newMeasuredLayout . height - ( rect . y - margin ) ;
164169 arrow . borderTopColor = arrowColor ;
170+ arrow . borderLeftColor = "transparent" ;
171+ arrow . borderRightColor = "transparent" ;
172+ arrow . borderBottomColor = "transparent" ;
165173 arrow . bottom = tooltip . bottom - arrowSize * 2 ;
166174 }
167175
168176 if ( horizontalPosition === "left" ) {
169177 tooltip . right = Math . max (
170178 newMeasuredLayout . width - ( rect . x + rect . width ) ,
171- 0
179+ 0 ,
172180 ) ;
173181 tooltip . right =
174182 tooltip . right === 0 ? tooltip . right + margin : tooltip . right ;
@@ -182,9 +190,9 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
182190 arrow . left = tooltip . left + margin ;
183191 }
184192
185- sanitize ( arrow )
186- sanitize ( tooltip )
187- sanitize ( rect )
193+ sanitize ( arrow ) ;
194+ sanitize ( tooltip ) ;
195+ sanitize ( rect ) ;
188196
189197 const animate = [
190198 [ "top" , rect . y ] ,
@@ -200,7 +208,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
200208 easing,
201209 useNativeDriver : false ,
202210 } ) ;
203- } )
211+ } ) ,
204212 ) . start ( ) ;
205213 } else {
206214 animate . forEach ( ( [ key , value ] ) => {
@@ -227,7 +235,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
227235 isAnimated ,
228236 arrowSize ,
229237 margin ,
230- ]
238+ ] ,
231239 ) ;
232240
233241 const animateMove = useCallback < CopilotModalHandle [ "animateMove" ] > (
@@ -244,7 +252,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
244252 } ) ;
245253 } ) ;
246254 } ,
247- [ _animateMove ]
255+ [ _animateMove ] ,
248256 ) ;
249257
250258 const reset = ( ) => {
@@ -271,7 +279,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
271279 animateMove,
272280 } ;
273281 } ,
274- [ animateMove ]
282+ [ animateMove ] ,
275283 ) ;
276284
277285 const modalVisible = containerVisible || visible ;
@@ -346,7 +354,6 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
346354 >
347355 < StepNumberComponent />
348356 </ Animated . View >
349-
350357 { ! ! arrowSize && (
351358 < Animated . View key = "arrow" style = { [ styles . arrow , arrowStyles ] } />
352359 ) }
@@ -359,7 +366,7 @@ export const CopilotModal = forwardRef<CopilotModalHandle, Props>(
359366 </ >
360367 ) ;
361368 }
362- }
369+ } ,
363370) ;
364371
365372const floorify = ( obj : Record < string , any > ) => {
@@ -382,4 +389,4 @@ const removeNan = (obj: Record<string, any>) => {
382389const sanitize = ( obj : Record < any , any > ) => {
383390 floorify ( obj ) ;
384391 removeNan ( obj ) ;
385- }
392+ } ;
0 commit comments