Skip to content

Commit ab8acbd

Browse files
authored
Merge pull request #9748 from scratchfoundation/hotfix/uepr-323-fix-corner-cases-on-manual-update-tooltip-overlay-css
fix: use more robust css selectors and add additional property to pre…
2 parents 69d9aba + f242eeb commit ab8acbd

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/views/preview/project-view.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,8 @@ class Preview extends React.Component {
985985
}
986986
highlightSetThumbnailButton () {
987987
const highlightDriver = driver({
988-
popoverClass: 'driverjs-theme'
988+
popoverClass: 'driverjs-theme',
989+
stagePadding: 5
989990
});
990991
highlightDriver.highlight({
991992
element: 'span[class*="stage-header_setThumbnailButton"]'

src/views/preview/project-view.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,36 @@
55
// directly, and since we have two driverjs instances in the component requiring
66
// different behaviors (one acts like a tooltip, the other like a highlight),
77
// we need to be specific.
8-
.driver-active:has(.tooltip-set-thumbnail) * {
8+
.driver-active * {
99
pointer-events: auto !important;
1010
}
1111

12+
.driver-active .driver-overlay {
13+
pointer-events: none !important;
14+
}
15+
16+
.driver-active:has(.tooltip-set-thumbnail) > .driver-overlay {
17+
z-index: -1 !important;
18+
visibility: hidden;
19+
}
20+
21+
// Fallback to a more manual selector, in case the browser does not
22+
// support :has(). This has the downside of depending on DOM order,
23+
// but it should still work for the majority of cases.
24+
// This code needs to be in a separate definition from the selector above -
25+
// if we define it in the same place (e.g. separated by a comma),
26+
// older browsers end up not applying the whole style.
1227
.tooltip-set-thumbnail ~ .driver-overlay {
1328
z-index: -1 !important;
29+
visibility: hidden;
1430
}
1531

1632
.driver-popover.tooltip-set-thumbnail {
1733
padding: 18px;
1834
background-color: $ui-blue;
1935
color: white;
2036
text-align: center;
21-
z-index: 10;
37+
z-index: 9;
2238
}
2339

2440
.driver-popover.tooltip-set-thumbnail .driver-popover-title {

0 commit comments

Comments
 (0)