Skip to content

Commit

Permalink
fix: Modify Tooltip placements config (ant-design#37960)
Browse files Browse the repository at this point in the history
* fix: Modify Tooltip placements config

* fix: Modify Tooltip placements verticalArrowShift

* fix: sync tooltip & popover arrow offset

* fix: modify dropdown arrow width

---------

Co-authored-by: afc163 <[email protected]>
  • Loading branch information
hongzzz and afc163 authored Aug 11, 2024
1 parent 4bc4d7a commit 59fef7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/_util/placements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function getOverflowOptions(autoAdjustOverflow?: boolean | AdjustOverflow

export default function getPlacements(config: PlacementsConfig) {
const {
arrowWidth = 4,
arrowWidth = 5,
horizontalArrowShift = 16,
verticalArrowShift = 8,
autoAdjustOverflow,
Expand Down
3 changes: 3 additions & 0 deletions components/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ const Tooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => {
return (
builtinPlacements ||
getPlacements({
arrowWidth: 11,
horizontalArrowShift: 16,
verticalArrowShift: 12,
arrowPointAtCenter,
autoAdjustOverflow,
})
Expand Down
4 changes: 2 additions & 2 deletions components/tooltip/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@tooltip-arrow-rotate-width: sqrt(@tooltip-arrow-width * @tooltip-arrow-width * 2) +
@tooltip-arrow-shadow-width * 2;

@tooltip-arrow-offset-vertical: 5px; // 8 - 3px
@tooltip-arrow-offset-horizontal: 13px; // 16 - 3px
@tooltip-arrow-offset-vertical: 12px;
@tooltip-arrow-offset-horizontal: 16px;

// Base class
.@{tooltip-prefix-cls} {
Expand Down

0 comments on commit 59fef7d

Please sign in to comment.