Skip to content

Commit

Permalink
Merge pull request #411 from CirclesUBI/fix/search-fix
Browse files Browse the repository at this point in the history
Fix/search fix
  • Loading branch information
codeho authored Aug 23, 2023
2 parents af0f185 + 1e0afe3 commit fe0eb56
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"qr-scanner": "^1.4.2",
"quill": "^1.3.7",
"react-image-file-resizer": "^0.4.8",
"simplebar": "^5.3.9",
"simplebar": "^6.2.5",
"string-replace-loader": "^3.1.0",
"style-loader": "^3.3.1",
"svelte-easy-crop": "^1.0.7",
Expand All @@ -118,4 +118,4 @@
"browserslist": [
"defaults"
]
}
}
18 changes: 10 additions & 8 deletions shell/src/shared/molecules/Select/List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,17 @@ function handleKeyDown(e) {
}
function scrollToActiveItem(className) {
if (isVirtualList || !container) return;
let input = document.getElementById("dropdownSelectInput");
input.scrollIntoView();
// if (isVirtualList || !container) return;
let offsetBounding;
const focusedElemBounding = container.querySelector(`.listItem .${className}`);
if (focusedElemBounding) {
offsetBounding = container.getBoundingClientRect().bottom - focusedElemBounding.getBoundingClientRect().bottom;
}
// let offsetBounding;
// const focusedElemBounding = container.querySelector(`.listItem .${className}`);
// if (focusedElemBounding) {
// offsetBounding = container.getBoundingClientRect().bottom - focusedElemBounding.getBoundingClientRect().bottom;
// }
container.scrollTop -= offsetBounding;
// container.scrollTop -= offsetBounding;
}
function isItemActive(item, selectedValue, optionIdentifier) {
Expand Down Expand Up @@ -218,7 +220,7 @@ function isItemHover(hoverItemIndex, item, itemIndex, items) {
{/if}

{#if !isVirtualList}
<div data-simplebar class="listContainer">
<div class="listContainer">
{#if items}
{#each items as item, i}
{#if item.isGroupHeader && !item.isSelectable}
Expand Down
3 changes: 2 additions & 1 deletion shell/src/shared/molecules/Select/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ function handleWindowClick(event) {
function handleClick() {
if (isDisabled) return;
isFocused = true;
// listOpen = !listOpen;
listOpen = !listOpen;
}
export function handleClear() {
Expand Down Expand Up @@ -726,6 +726,7 @@ onDestroy(() => {
class:h-12="{staticList !== true}">
<div class="flex-grow">
<input
id="dropdownSelectInput"
type="text"
on:blur
name="searchTerm"
Expand Down

0 comments on commit fe0eb56

Please sign in to comment.