We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5f2671 commit 1f63ee9Copy full SHA for 1f63ee9
src/PickerTrigger/index.tsx
@@ -101,14 +101,17 @@ function PickerTrigger({
101
stretch="minWidth"
102
getPopupContainer={getPopupContainer}
103
onPopupAlign={(_, align) => {
104
- Object.keys(BUILT_IN_PLACEMENTS).forEach((key) => {
105
- if (
+ if (!setAlignedPlacement) return;
+
106
+ const matchedKey = Object.keys(BUILT_IN_PLACEMENTS).find(
107
+ (key) =>
108
BUILT_IN_PLACEMENTS[key].points[0] === align.points[0] &&
109
BUILT_IN_PLACEMENTS[key].points[1] === align.points[1]
- ) {
- setAlignedPlacement?.(key);
110
- }
111
- });
+ );
112
+ if (matchedKey) {
113
+ setAlignedPlacement(matchedKey);
114
+ }
115
}}
116
onPopupVisibleChange={(nextVisible) => {
117
if (!nextVisible) {
0 commit comments