mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-13 07:43:43 +08:00
fix 修复 选择图标时tooltip显示后滚动出现错位现象
This commit is contained in:
parent
e80b187810
commit
682b931931
@ -71,6 +71,8 @@ const iconOptions: Array<[string, IconComponent]> = [
|
||||
['ai', RobotOutlined]
|
||||
];
|
||||
|
||||
const getIconTooltipContainer = (triggerNode: HTMLElement) => triggerNode.parentElement ?? document.body;
|
||||
|
||||
export interface IconSelectProps {
|
||||
value?: string;
|
||||
onChange?: (value: string) => void;
|
||||
@ -125,7 +127,13 @@ export default function IconSelect({ value, onChange, width = '100%' }: IconSele
|
||||
<div className="icon-select-list-react">
|
||||
{matchedIcons.map(([name, Icon]) => {
|
||||
return (
|
||||
<Tooltip key={name} title={name}>
|
||||
<Tooltip
|
||||
key={name}
|
||||
title={name}
|
||||
placement="bottom"
|
||||
getPopupContainer={getIconTooltipContainer}
|
||||
styles={{ root: { pointerEvents: 'none' } }}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className={`icon-select-item-react${value === name ? ' active' : ''}`}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user