mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-25 07:25:12 +00:00
fix: scrolling to note
This commit is contained in:
parent
2a50e6e9e7
commit
bd0186296c
1 changed files with 3 additions and 2 deletions
|
@ -302,6 +302,7 @@ const isRenote = (
|
|||
);
|
||||
|
||||
const rootEl = shallowRef<HTMLElement>();
|
||||
const noteEl = shallowRef<HTMLElement>();
|
||||
const menuButton = shallowRef<HTMLElement>();
|
||||
const menuVersionsButton = shallowRef<HTMLElement>();
|
||||
const renoteButton = shallowRef<HTMLElement>();
|
||||
|
@ -808,12 +809,12 @@ function setScrolling() {
|
|||
onMounted(() => {
|
||||
document.addEventListener('wheel', setScrolling);
|
||||
isScrolling = false;
|
||||
rootEl.value?.scrollIntoView({ block: 'center' });
|
||||
noteEl.value?.scrollIntoView({ block: 'center' });
|
||||
});
|
||||
|
||||
onUpdated(() => {
|
||||
if (!isScrolling) {
|
||||
rootEl.value?.scrollIntoView({ block: 'center' });
|
||||
noteEl.value?.scrollIntoView({ block: 'center' });
|
||||
if (location.hash) {
|
||||
location.replace(location.hash); // Jump to highlighted reply
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue