Skip to content

Commit

Permalink
Fix search box focus on tab press sometimes notworking (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed May 21, 2024
1 parent c30aa6c commit b12620e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/routes/pages/search/SearchPage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { IonPage, IonSearchbar, IonToolbar } from "@ionic/react";
import AppContent from "../../../features/shared/AppContent";
import { createRef, useState } from "react";
import { createRef, useRef, useState } from "react";
import SearchOptions from "../../../features/search/SearchOptions";
import useLemmyUrlHandler from "../../../features/shared/useLemmyUrlHandler";
import { useOptimizedIonRouter } from "../../../helpers/useOptimizedIonRouter";
import { css, cx } from "@linaria/core";
import AppHeader from "../../../features/shared/AppHeader";
import EmptySearch from "../../../features/search/EmptySearch";
import { findCurrentPage } from "../../../helpers/ionic";
import { useSetActivePage } from "../../../features/auth/AppContext";

const SEARCH_EL_CLASSNAME = "search-page-searchbar";

Expand All @@ -21,13 +22,16 @@ export const focusSearchBar = () =>
?.setFocus();

export default function SearchPage() {
const pageRef = useRef<HTMLElement>(null);
const [search, setSearch] = useState("");
const router = useOptimizedIonRouter();
const { redirectToLemmyObjectIfNeeded } = useLemmyUrlHandler();
const searchBarRef = createRef<HTMLIonSearchbarElement>();

useSetActivePage(pageRef);

return (
<IonPage className="grey-bg">
<IonPage ref={pageRef} className="grey-bg">
<AppHeader>
<IonToolbar>
<form
Expand Down
2 changes: 1 addition & 1 deletion src/routes/pages/settings/about/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function AboutPage() {
useSetActivePage(pageRef);

return (
<IonPage className="grey-bg" ref={pageRef}>
<IonPage ref={pageRef} className="grey-bg">
<AppHeader>
<IonToolbar>
<IonButtons slot="start">
Expand Down

0 comments on commit b12620e

Please sign in to comment.