Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/BlogFilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ export function BlogFilterBar({
{/* Mobile-only expandable column: the facet dropdowns stacked full-width,
animated open via a grid-rows height transition. */}
<div
aria-hidden={!mobileOpen}
inert={mobileOpen ? undefined : true}
className={twMerge(
'grid transition-[grid-template-rows] duration-300 ease-out motion-reduce:transition-none md:hidden',
mobileOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',
Expand Down
12 changes: 6 additions & 6 deletions src/routes/_library/$libraryId/$version.docs.blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ function RouteComponent() {
const { author, q } = Route.useSearch()
const navigate = Route.useNavigate()
const library = getLibrary(libraryId as LibraryId)
const selectedAuthor = author ? normalizeBlogAuthor(author) : undefined
const searchQuery = q ?? ''

const posts = Route.useLoaderData()
const authors = getDistinctAuthors(posts)
const normalizedAuthor = author ? normalizeBlogAuthor(author) : undefined
const selectedAuthor =
normalizedAuthor && authors.includes(normalizedAuthor)
? normalizedAuthor
: undefined

const authorFilteredPosts = selectedAuthor
? posts.filter((post) => post.authors.includes(selectedAuthor))
Expand Down Expand Up @@ -87,11 +91,7 @@ function RouteComponent() {
<div className="w-56 max-w-full">
<FormSelect
aria-label="Filter by author"
value={
selectedAuthor && authors.includes(selectedAuthor)
? selectedAuthor
: ''
}
value={selectedAuthor ?? ''}
onChange={(event) =>
navigate({
search: (prev) => ({
Expand Down
Loading