Skip to content

Commit bb1e7f0

Browse files
committed
improve(pages): improve notes inside note links
1 parent d739d18 commit bb1e7f0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

apps/client/src/code/pages/composables/use-page-navigation-interception.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ export function usePageNavigationInterception() {
1111

1212
// Ignore if it's not a link
1313

14-
const anchor = target.closest('a[href]');
14+
const closestAnchor = target.closest('a');
1515

16-
if (anchor == null) {
16+
const href = closestAnchor?.getAttribute('href') ?? '';
17+
18+
if (!href) {
19+
event.preventDefault();
1720
return;
1821
}
1922

@@ -35,8 +38,6 @@ export function usePageNavigationInterception() {
3538

3639
// Allow default action if it's not a page link
3740

38-
const href = anchor.getAttribute('href') ?? '';
39-
4041
if (
4142
!(
4243
href.startsWith('/pages/') ||

apps/client/src/layouts/PagesLayout/MainContent/DisplayPage/DisplayScreens/DisplayWorld/DisplayNote/NoteContent.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:style="{ cursor: note.react.cursor }"
77
tabindex="-1"
88
target="_blank"
9+
draggable="false"
910
>
1011
<div
1112
class="note-content"
@@ -53,7 +54,7 @@ function onLeftPointerDown(event: PointerEvent) {
5354
}
5455
5556
if (
56-
(note.react.collab.link || (event.target as Element).closest('a[href]')) &&
57+
note.react.collab.link &&
5758
!event.altKey &&
5859
!event.shiftKey &&
5960
!internals.mobileAltKey &&

apps/client/src/layouts/PagesLayout/MainContent/DisplayPage/DisplayScreens/DisplayWorld/DisplayNote/NoteSection/NoteContainerSection/NoteListContainer.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,7 @@ useResizeObserver(
286286
display: flex;
287287
288288
margin: 3px;
289+
290+
cursor: default;
289291
}
290292
</style>

apps/client/src/layouts/PagesLayout/MainContent/DisplayPage/DisplayScreens/DisplayWorld/DisplayNote/NoteSection/NoteContainerSection/NoteSpatialContainer.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
>
99
<div
1010
class="note-spatial-background"
11-
@click.left="onLeftClick"
11+
@click.left.stop.prevent="onLeftClick"
1212
>
1313
<!-- Placeholder -->
1414

@@ -147,6 +147,8 @@ async function onLeftClick(event: MouseEvent) {
147147
border-radius: 5px;
148148
149149
background-color: rgba(0, 0, 0, 0.4);
150+
151+
cursor: default;
150152
}
151153
152154
.note-spatial-background {

0 commit comments

Comments
 (0)