1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-17 18:32:35 +00:00

prevent clicking outside of highland and scroll better to element

This commit is contained in:
Bram Wiepjes 2025-03-31 14:30:17 +02:00
parent c6b7e9de27
commit 722dfb1bc8
5 changed files with 15 additions and 5 deletions
web-frontend/modules/core

View file

@ -1,9 +1,16 @@
.guided-tour-step__container {
background: transparent;
pointer-events: all;
z-index: $z-index-guided-tour-container;
@include absolute(0, 0, 0, 0);
}
.guided-tour-step {
position: absolute;
box-sizing: border-box;
width: 326px;
background-color: $palette-neutral-1200;
pointer-events: all;
display: flex;
flex-direction: column;
z-index: $z-index-guided-tour-step;
@ -28,7 +35,6 @@
// Positioned right from the parent, aligned to the top of it.
&--right-top {
top: 0;
left: calc(100% + 12px);
&::after {

View file

@ -6,7 +6,6 @@
height: 200px;
z-index: $z-index-highlight-overlay;
box-sizing: content-box;
pointer-events: none;
transition: top 0.1s ease, left 0.1s ease, width 0.1s ease, height 0.1s ease;
@include rounded($rounded);

View file

@ -27,6 +27,7 @@ $z-index-tooltip: 8 !default;
$z-index-toasts: 9 !default;
// This is an overlay over all element, so it must be the highest.
$z-index-guided-tour-container: 99 !default;
$z-index-highlight-overlay: 100 !default;
$z-index-guided-tour-step: 101 !default;

View file

@ -83,7 +83,11 @@ export default {
this.scrollableParents.add(scrollableParent)
scrollableParent.addEventListener('scroll', this.update)
}
element.scrollIntoView({ behavior: 'smooth' })
element.scrollIntoView({
behavior: 'smooth',
inline: 'center',
block: 'center',
})
})
},
update() {

View file

@ -1,5 +1,5 @@
<template>
<div>
<div v-if="activeGuidedTours.length > 0" class="guided-tour-step__container">
<Highlight ref="highlight" :get-parent="getParent">
<GuidedTourStep
v-if="currentStep"