Skip to content

Commit e842fe4

Browse files
committed
feat: pass rest styles from pointerStyle to PointerWrapper
1 parent 62e33d5 commit e842fe4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils/pointer.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ export function getPointerStyles(props: PointerProps) {
6969

7070
export function getPointerWrapperStyle(
7171
props: PointerProps,
72-
layout: LayoutRectangle
72+
layout: LayoutRectangle = { x: 0, y: 0, width: 0, height: 0 }
7373
): ViewStyle {
7474
const { position = 'top', pointerStyle: pointerStyles } = props;
75-
const { width, height } = getSafeStyle(pointerStyles);
75+
const { width, height, ...restStyle } = getSafeStyle(pointerStyles);
7676

7777
const size = isVerticalPosition(position) ? height : width;
7878

@@ -84,28 +84,32 @@ export function getPointerWrapperStyle(
8484
return {
8585
top: -size,
8686
left: sideWhenVertical,
87+
...restStyle,
8788
};
8889
}
8990
case 'left': {
9091
return {
9192
right: -size,
9293
top: sideWhenHorizontal,
94+
...restStyle,
9395
};
9496
}
9597
case 'top': {
9698
return {
9799
bottom: -size,
98100
left: sideWhenVertical,
101+
...restStyle,
99102
};
100103
}
101104
case 'right': {
102105
return {
103106
left: -size,
104107
top: sideWhenHorizontal,
108+
...restStyle,
105109
};
106110
}
107111
default: {
108-
return {};
112+
return { ...restStyle };
109113
}
110114
}
111115
}

0 commit comments

Comments
 (0)