-
Notifications
You must be signed in to change notification settings - Fork 1
fix: preserve ordinary popover margins by default #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -612,11 +612,13 @@ export const calculateWindowAdjustment = ( | |
| triggerCoordinates?: ReferenceCoordinates, | ||
| eventElementRect?: DOMRect, | ||
| isReplace: boolean = false, | ||
| preserveHorizontalAlignment: boolean = false, | ||
| ): PopoverStyles => { | ||
| const triggerTop = triggerCoordinates ? triggerCoordinates.top + triggerCoordinates.height : bodyHeight / 2 - contentHeight / 2; | ||
| const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0; | ||
| let left = coordLeft; | ||
| const horizontal = side === 'left' || side === 'right' || side === 'start' || side === 'end'; | ||
| // Projected rail controls opt in; ordinary popovers retain their existing margin. | ||
| const horizontal = preserveHorizontalAlignment && (side === 'left' || side === 'right' || side === 'start' || side === 'end'); | ||
| let top = !isReplace ? coordTop + (horizontal ? 0 : POPOVER_IOS_BODY_MARGIN) : coordTop - triggerHeight; | ||
| if (horizontal && !isReplace) top = Math.max(bodyPadding, Math.min(top, bodyHeight - bodyPadding - contentHeight)); | ||
|
Comment on lines
+621
to
623
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 通常の横配置ポップオーバーが画面外に切れる 横配置でオプションを指定しないと、8px の余白だけが加わり、従来の上下方向のクランプが働きません。画面端付近ではポップオーバーの内容が画面外に出ます。 Learn moreこの関数はポップオーバーの座標を画面内に調整します。横配置では従来、 Example: 画面高 636px、コンテンツ高 52px、 Recommended fix: 横配置かどうかの判定と、余白を省くためのオプトイン判定を分離してください。通常配置には 8px の余白を残しつつ、余白を適用した後の座標も上下の画面内に制限し、オプトイン時の配置も維持してください。 Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| let bottom; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Vertical Bars のオプトイン指定箇所を確認
説明にあるテーマ側の
preserveHorizontalAlignment: true指定は、この変更には含まれていません。投影コントロールの配置を維持するため、対応するテーマ側の変更が適用されるか確認してください。Was this helpful? React with 👍 or 👎 to provide feedback.