Skip to content

Commit 59bea01

Browse files
committed
fix tab scrollIntoView
1 parent fc47415 commit 59bea01

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/livecodes/UI/create-language-menus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export const createMultiFileEditorTab = ({
311311
getEditorTabScroller()?.insertBefore(editorSelector, scrollTo);
312312

313313
if (isNewFile) {
314-
scrollTo?.scrollIntoView({ behavior: 'smooth', inline: 'end' });
314+
scrollTo?.scrollIntoView({ behavior: 'smooth', inline: 'end', block: 'end' });
315315
onDblClick();
316316
}
317317
if (isHidden) {

src/livecodes/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ const showEditor = (editorId: EditorId | (string & {}) = 'markup', isUpdate = fa
941941
titles.forEach((title) => {
942942
if (title.dataset.editor === editorId) {
943943
title.classList.add('active');
944-
title.scrollIntoView({ behavior: 'smooth' });
944+
title.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'nearest' });
945945
} else {
946946
title.classList.remove('active');
947947
}

0 commit comments

Comments
 (0)