mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Place the Data Layers group label outside the panel and soften the finder's focus
The group label is drawn on the page just outside the panel's edge instead of over the rows; the panel clips what leaves it, so the label is teleported to the body and placed from the tick. The finder shows focus as a soft ring on the field's frame in place of the hard outline round the bare input. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
584e77dc4f
commit
0550f7c2d2
3 files changed
+53
-20
No files matched your search
@@ -32,6 +32,17 @@ function syncCurrent() {
|
||||
if (scrolls && list.scrollTop + list.clientHeight >= list.scrollHeight - 2) index = sections.value.length - 1;
|
||||
current.value = Math.max(0, index);
|
||||
}
|
||||
// The name of the tick being pointed at or focused. It is drawn on the page
|
||||
// itself, just outside the panel's edge: the panel clips what leaves it, and a
|
||||
// label inside would cover the rows.
|
||||
const tip = ref(null);
|
||||
function showTip(event, section) {
|
||||
const box = event.currentTarget.getBoundingClientRect();
|
||||
tip.value = { label: section.label, left: `${Math.round(box.right + 10)}px`, top: `${Math.round(box.top + box.height / 2)}px` };
|
||||
}
|
||||
const hideTip = () => {
|
||||
tip.value = null;
|
||||
};
|
||||
function jump(i) {
|
||||
const h = headings()[i];
|
||||
if (!h || !list) return;
|
||||
@@ -67,8 +78,13 @@ onBeforeUnmount(() => {
|
||||
:aria-label="t('Jump to {name}', { name: section.label })"
|
||||
:aria-current="section.i === current ? 'true' : undefined"
|
||||
@click="jump(section.i)"
|
||||
>
|
||||
<span class="layer-section-index__label" aria-hidden="true">{{ section.label }}</span>
|
||||
</button>
|
||||
@mouseenter="showTip($event, section)"
|
||||
@mouseleave="hideTip"
|
||||
@focus="showTip($event, section)"
|
||||
@blur="hideTip"
|
||||
></button>
|
||||
<Teleport to="body">
|
||||
<span v-if="tip" class="layer-section-index__label" :style="{ left: tip.left, top: tip.top }" aria-hidden="true">{{ tip.label }}</span>
|
||||
</Teleport>
|
||||
</nav>
|
||||
</template>
|
||||
Reference in new issue
Block a user