diff --git a/apps/app-frontend/src/app/shell/sidebar/index.vue b/apps/app-frontend/src/app/shell/sidebar/index.vue index 467fc0bf9de..a431fa52e3a 100644 --- a/apps/app-frontend/src/app/shell/sidebar/index.vue +++ b/apps/app-frontend/src/app/shell/sidebar/index.vue @@ -15,7 +15,7 @@ import { injectOnboardingChecklist } from '@/providers/onboarding-checklist' import Promotion from './promotion.vue' -defineProps<{ +const props = defineProps<{ credentials: ModrinthCredentials | null | undefined hasPlus: boolean showAd: boolean @@ -37,6 +37,9 @@ const friends = ref | null>(null) const scrollContainer = ref(null) const scrollViewport = ref(null) const upgradeHeight = ref(0) +const promotionPaddingStyle = computed(() => + props.showAd ? { paddingBottom: `calc(1rem + ${upgradeHeight.value}px)` } : undefined, +) const { showTopFade, showBottomFade, checkScrollState } = useScrollIndicator(scrollViewport) let removeScrollbarListener: (() => void) | undefined @@ -103,7 +106,11 @@ const messages = defineMessages({ @login-minecraft="accounts?.login()" @login-modrinth="emit('login-modrinth')" /> - +
@@ -1024,13 +1037,16 @@ function handleSearchClick() { } } -function handleSearchIconClick() { - if (isOpen.value) { - closeDropdown(false) - return - } +function handleSearchChevronClick() { + if (props.disabled) return - openDropdown() + const wasOpen = isOpen.value + searchTriggerRef.value?.focus() + if (wasOpen) { + closeDropdown() + } else { + openDropdown() + } } function handleWindowResize() { @@ -1062,10 +1078,17 @@ function startPositionTracking() { listenerWindow.addEventListener('beforeunload', handleWindowClose) listenerWindow.visualViewport?.addEventListener('scroll', handleViewportChange) listenerWindow.visualViewport?.addEventListener('resize', handleViewportChange) - stopOutsideClick = onClickOutside(dropdownRef, () => closeDropdown(false), { - window: listenerWindow, - ignore: outsideClickIgnoreTargets, - }) + stopOutsideClick = onClickOutside( + dropdownRef, + (event) => { + if (containerRef.value && event.composedPath().includes(containerRef.value)) return + closeDropdown(false) + }, + { + window: listenerWindow, + ignore: outsideClickIgnoreTargets, + }, + ) } function stopPositionTracking() { diff --git a/packages/ui/src/components/search/SearchDependsOnFilter.vue b/packages/ui/src/components/search/SearchDependsOnFilter.vue index f52b5018bf0..5d4636146d5 100644 --- a/packages/ui/src/components/search/SearchDependsOnFilter.vue +++ b/packages/ui/src/components/search/SearchDependsOnFilter.vue @@ -4,6 +4,7 @@ :model-value="pendingProjectId" :project-types="selectableProjectTypes" :exclude-project-ids="dependencyProjectIds" + :force-direction="dropdownDirection" :search-placeholder="formatMessage(messages.searchContentPlaceholder)" :show-chevron="false" :sync-with-selection="false" @@ -70,6 +71,7 @@ :model-value="selectedProjectId" :project-types="selectableProjectTypes" :search-placeholder="formatMessage(messages.searchProjectPlaceholder)" + :force-direction="dropdownDirection" :show-chevron="false" clearable search-input-variant="button" @@ -97,6 +99,7 @@