Skip to content

Commit

Permalink
fix: Add missing tooltip-zIndex (#30432)
Browse files Browse the repository at this point in the history
* fix: Add missing tooltip-zIndex

* docs: Update docs
  • Loading branch information
zombieJ committed May 7, 2021
1 parent 8e76c1c commit 11b7676
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions components/tooltip/__tests__/type.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ describe('Tooltip.typescript', () => {
expect(tooltip).toBeTruthy();
expect(tooltip2).toBeTruthy();
});

it('Tooltip support zIndex', () => {
const tooltip = (
<Tooltip title="title" zIndex={999}>
<div />
</Tooltip>
);

expect(tooltip).toBeTruthy();
});
});
1 change: 1 addition & 0 deletions components/tooltip/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` | |
| trigger | Tooltip trigger mode. Could be multiple by passing an array | `hover` \| `focus` \| `click` \| `contextMenu` \| Array&lt;string> | `hover` | |
| visible | Whether the floating tooltip card is visible or not | boolean | false | |
| zIndex | Config `z-index` of Tooltip | number | - | |
| onVisibleChange | Callback executed when visibility of the tooltip card is changed | (visible) => void | - | |

## Note
Expand Down
1 change: 1 addition & 0 deletions components/tooltip/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Vyyeu8jq2/Tooltp.svg
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` | |
| trigger | 触发行为,可选 `hover` \| `focus` \| `click` \| `contextMenu`,可使用数组设置多个触发行为 | string \| string\[] | `hover` | |
| visible | 用于手动控制浮层显隐 | boolean | false | |
| zIndex | 设置 Tooltip 的 `z-index` | number | - | |
| onVisibleChange | 显示隐藏的回调 | (visible) => void | - | |

## 注意
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"rc-table": "~7.13.0",
"rc-tabs": "~11.7.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.1.0",
"rc-tooltip": "~5.1.1",
"rc-tree": "~4.1.0",
"rc-tree-select": "~4.3.0",
"rc-trigger": "^5.2.1",
Expand Down

0 comments on commit 11b7676

Please sign in to comment.