Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
908375c2
Unverified
Commit
908375c2
authored
2 years ago
by
Aleksandr Lesnenko
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix tooltip overflow (#23475)
* fix tooltip overflow * explicit default for preventOverflow * check ci
parent
a99ec1df
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/components/Tooltip/Tooltip.tsx
+21
-1
21 additions, 1 deletion
frontend/src/metabase/components/Tooltip/Tooltip.tsx
frontend/src/metabase/visualizations/components/ChartTooltip/ChartTooltip.tsx
+1
-0
1 addition, 0 deletions
...e/visualizations/components/ChartTooltip/ChartTooltip.tsx
with
22 additions
and
1 deletion
frontend/src/metabase/components/Tooltip/Tooltip.tsx
+
21
−
1
View file @
908375c2
import
React
from
"
react
"
;
import
React
,
{
useMemo
}
from
"
react
"
;
import
PropTypes
from
"
prop-types
"
;
import
*
as
Tippy
from
"
@tippyjs/react
"
;
import
*
as
ReactIs
from
"
react-is
"
;
...
...
@@ -26,6 +26,7 @@ export interface TooltipProps
"
delay
"
|
"
reference
"
|
"
placement
"
|
"
maxWidth
"
|
"
offset
"
>
>
{
preventOverflow
?:
boolean
;
tooltip
?:
React
.
ReactNode
;
children
?:
React
.
ReactNode
;
isEnabled
?:
boolean
;
...
...
@@ -69,6 +70,7 @@ function Tooltip({
offset
,
isEnabled
,
isOpen
,
preventOverflow
=
false
,
maxWidth
=
200
,
}:
TooltipProps
)
{
const
visible
=
isOpen
!=
null
?
isOpen
:
undefined
;
...
...
@@ -76,6 +78,23 @@ function Tooltip({
const
disabled
=
isEnabled
===
false
;
const
targetProps
=
getTargetProps
(
reference
,
children
);
const
popperOptions
=
useMemo
(
()
=>
preventOverflow
?
{
modifiers
:
[
{
name
:
"
preventOverflow
"
,
options
:
{
altAxis
:
true
,
},
},
],
}
:
undefined
,
[
preventOverflow
],
);
if
(
tooltip
&&
targetProps
)
{
return
(
<
TippyComponent
...
...
@@ -92,6 +111,7 @@ function Tooltip({
placement
=
{
placement
}
offset
=
{
offset
}
zIndex
=
{
DEFAULT_Z_INDEX
}
popperOptions
=
{
popperOptions
}
{
...
targetProps
}
/>
);
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/visualizations/components/ChartTooltip/ChartTooltip.tsx
+
1
−
0
View file @
908375c2
...
...
@@ -51,6 +51,7 @@ const ChartTooltip = ({ hovered, settings }: ChartTooltipProps) => {
return
target
?
(
<
Tooltip
preventOverflow
reference
=
{
target
}
isOpen
=
{
isOpen
}
tooltip
=
{
tooltip
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment