Tooltip padding
This commit is contained in:
@@ -164,9 +164,11 @@ function ToolTipEx(props: ToolTipExProps) {
|
||||
|
||||
let effectiveTitle: React.ReactNode | null = null;
|
||||
let placement: "top-start" | "right" = "top-start";
|
||||
let popperOffset = 0;
|
||||
if (valueTooltip !== undefined && !isLongPress) {
|
||||
effectiveTitle = valueTooltip; // Show value tooltip if available
|
||||
placement = "right";
|
||||
popperOffset = 16;
|
||||
}
|
||||
else {
|
||||
if (open || isLongPress) {
|
||||
@@ -228,10 +230,22 @@ function ToolTipEx(props: ToolTipExProps) {
|
||||
|
||||
title={effectiveTitle}
|
||||
placement={placement}
|
||||
|
||||
arrow enterDelay={1500} enterNextDelay={1500}
|
||||
slotProps={{
|
||||
transition: {
|
||||
timeout: 0 // Disable transition for the tooltip
|
||||
},
|
||||
popper: {
|
||||
modifiers: [
|
||||
{
|
||||
name: 'offset',
|
||||
options: {
|
||||
offset: [0, popperOffset],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user