Skip to content

Commit

Permalink
Additional cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DTCurrie committed Aug 29, 2023
1 parent 4a7e9a2 commit 75c4d67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 0 additions & 7 deletions packages/core/src/lib/select/scroll.ts

This file was deleted.

5 changes: 3 additions & 2 deletions packages/core/src/lib/select/searchable-select.svelte
Expand Up @@ -6,7 +6,6 @@ import cx from 'classnames';
import Icon from '$lib/icon/icon.svelte';
import SelectMenu from './select-menu.svelte';
import type { SelectState } from './select.svelte';
import { isOptionInScrollView } from './scroll';
import {
type SortOptions,
getSearchResults,
Expand Down Expand Up @@ -109,8 +108,10 @@ const handleNavigate = (direction: number) => {
}
const element = menu.children[navigationIndex]!;
const { top, bottom } = element.getBoundingClientRect();
const menuRect = menu.getBoundingClientRect();
if (!isOptionInScrollView(element)) {
if (bottom < menuRect.bottom && top > menuRect.top) {
element.scrollIntoView({ block: 'nearest' });
}
Expand Down

0 comments on commit 75c4d67

Please sign in to comment.