Skip to content

Commit

Permalink
Merge pull request cuke-ui#5 from cc616/master
Browse files Browse the repository at this point in the history
fix: tooltip position left
  • Loading branch information
lijinke666 authored Nov 29, 2018
2 parents 2d88a23 + c8adb29 commit baae6d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class Tooltip extends PureComponent {
static propTypes = {
prefixCls: PropTypes.string.isRequired,
onVisibleChange: PropTypes.func,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
title: PropTypes.node,
position: PropTypes.oneOf(["top", "right", "left", "bottom"]),
theme: PropTypes.oneOf(themes)
};
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class Tooltip extends PureComponent {
},
left: {
top: top + scrollY + height / 2 - wrapperHeight / 2,
left: left + scrollX - width
left: left + scrollX - wrapperWidth
},
right: {
top: top + scrollY + height / 2 - wrapperHeight / 2,
Expand Down
2 changes: 1 addition & 1 deletion components/tooltip/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}
}
&.@{prefixCls}-position-left {
margin-left: -8px;
margin-left: -@tooltip-offset;
&::before, &::after {
transform: translateY(-50%);
top: 50%;
Expand Down

0 comments on commit baae6d9

Please sign in to comment.