remove counter of selected feed
This commit is contained in:
@@ -10,6 +10,24 @@ const { sync, showModal, viewMode, toggleViewMode, layout, toggleLayout, markAll
|
||||
|
||||
const headerRef = ref(null)
|
||||
|
||||
// Native <select>/<option> has no "is open" state — the closed box just shows
|
||||
// the selected option's text verbatim, so per-option unread counts can only be
|
||||
// toggled based on focus, since the popup is only ever shown while focused.
|
||||
// @focus ~ opening (shows counts); @change (picking an option closes the
|
||||
// popup but keeps focus, so no blur fires) and @blur (focus left without
|
||||
// picking) ~ closed (counts hidden, so the closed box just shows the name).
|
||||
const filterOpen = ref(false)
|
||||
|
||||
function onFilterFocus() {
|
||||
filterOpen.value = true
|
||||
refreshUnreadDisplay()
|
||||
}
|
||||
|
||||
function onFilterChange(event) {
|
||||
setFeedFilter(event.target.value || null)
|
||||
filterOpen.value = false
|
||||
}
|
||||
|
||||
// Scroll-driven show/hide: the header slides out of view on scroll-down and
|
||||
// back in on scroll-up. This is show/hide via `transform` (not the old
|
||||
// resize behaviour) — the header is position:fixed, so translating it never
|
||||
@@ -165,11 +183,12 @@ function handleToggleLayout() {
|
||||
class="app-nav__filter"
|
||||
:value="feedFilter ?? ''"
|
||||
aria-label="Filter by feed"
|
||||
@focus="refreshUnreadDisplay"
|
||||
@change="setFeedFilter($event.target.value || null)"
|
||||
@focus="onFilterFocus"
|
||||
@change="onFilterChange"
|
||||
@blur="filterOpen = false"
|
||||
>
|
||||
<option value="">All feeds</option>
|
||||
<option v-for="title in feedTitles" :key="title" :value="title">{{ title }} ({{ displayedFeedUnreadCounts[title] ?? 0 }})</option>
|
||||
<option v-for="title in feedTitles" :key="title" :value="title">{{ title }}<template v-if="filterOpen"> ({{ displayedFeedUnreadCounts[title] ?? 0 }})</template></option>
|
||||
</select>
|
||||
<button
|
||||
class="app-nav__hamburger"
|
||||
|
||||
Reference in New Issue
Block a user