createdByModal 基本上是一個脈輪模式,我在其中使用工具提示。每當我將滑鼠懸停在圖示上時,工具提示都會顯示在螢屏頂部而不是圖示頂部。在照片中,您可以看到忽略元素正在顯示在左上角

const CreatedByModal = () => {
return (
<Stack
spacing={"4"}
margin={"0px !important"}
alignItems={"center"}
px={{ base: "2", lg: "6" }}
pt={"2"}
>
<HStack justifyContent={"space-between"}>
<Tooltip
bg={"white"}
textAlign={"center"}
color={"black"}
placement="top"
label="Tip"
aria-label="A tooltip"
>
<AiFillWallet size={"1.2rem"} color={"#b1bad3"} />
</Tooltip>
<Tooltip
bg={"white"}
textAlign={"center"}
color={"black"}
placement="top"
label="Ignore"
aria-label="A tooltip"
>
<AiFillEyeInvisible size={"1.2rem"} color={"#b1bad3"} />
</Tooltip>
</HStack>
</Stack>
);
};
uj5u.com熱心網友回復:
您是否已經包裝了需要工具提示的組件forwardRef?
https://chakra-ui.com/docs/components/tooltip#usage
或者將您的圖示組件包裝在一個跨度中
https://chakra-ui.com/docs/components/tooltip#with-an-icon
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/495640.html
標籤:javascript 反应 脉轮
