From 5dbce9368202deb025043d51cab114405fd00664 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Fri, 26 Jul 2024 16:34:51 -0700 Subject: [PATCH] Changed positioning attributes to ToolTip Anchor Signed-off-by: Dan Dong --- .../components/legend/__snapshots__/legend.test.tsx.snap | 4 ++-- .../public/vislib/components/legend/_legend.scss | 9 ++++++--- .../public/vislib/components/legend/legend.tsx | 7 ++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/plugins/vis_type_vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap b/src/plugins/vis_type_vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap index 883ad3e83855..bff4c2c6df6f 100644 --- a/src/plugins/vis_type_vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap +++ b/src/plugins/vis_type_vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`VisLegend Component Legend closed should match the snapshot 1`] = `"
"`; +exports[`VisLegend Component Legend closed should match the snapshot 1`] = `"
"`; -exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; +exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; diff --git a/src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss b/src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss index c114c07f17b9..a91226cf7725 100644 --- a/src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss +++ b/src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss @@ -8,9 +8,6 @@ $visLegendLineHeight: $euiSize; .visLegend__toggle { border-radius: $euiBorderRadius; - position: absolute; - bottom: 0; - left: 0; display: flex; padding: $euiSizeXS; background-color: $euiColorEmptyShade; @@ -24,6 +21,12 @@ $visLegendLineHeight: $euiSize; } } +.visLegend__toggleTooltipAnchor { + position: absolute; + bottom: 0; + left: 0; +} + .visLegend__toggle--isOpen { background-color: transparentize($euiColorDarkestShade, 0.9); opacity: 1; diff --git a/src/plugins/vis_type_vislib/public/vislib/components/legend/legend.tsx b/src/plugins/vis_type_vislib/public/vislib/components/legend/legend.tsx index 2ebb6f85dbb5..2dee1407fc61 100644 --- a/src/plugins/vis_type_vislib/public/vislib/components/legend/legend.tsx +++ b/src/plugins/vis_type_vislib/public/vislib/components/legend/legend.tsx @@ -265,7 +265,12 @@ export class VisLegend extends PureComponent { return (
- +