From aa0126ae3edf0c7604cb9e4027473ba86f151f01 Mon Sep 17 00:00:00 2001 From: Kant Date: Tue, 20 Aug 2024 09:43:14 +0200 Subject: [PATCH] fix: hidden header should show again when searching [LIVE-13727] --- .changeset/chilled-bikes-agree.md | 5 +++++ .../features/Web3Hub/screens/Web3HubSearch/index.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-bikes-agree.md diff --git a/.changeset/chilled-bikes-agree.md b/.changeset/chilled-bikes-agree.md new file mode 100644 index 000000000000..2b8e05ea3220 --- /dev/null +++ b/.changeset/chilled-bikes-agree.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +fix: hidden header should show again when searching diff --git a/apps/ledger-live-mobile/src/newArch/features/Web3Hub/screens/Web3HubSearch/index.tsx b/apps/ledger-live-mobile/src/newArch/features/Web3Hub/screens/Web3HubSearch/index.tsx index f179f0d35a65..b3f00fc55b4c 100644 --- a/apps/ledger-live-mobile/src/newArch/features/Web3Hub/screens/Web3HubSearch/index.tsx +++ b/apps/ledger-live-mobile/src/newArch/features/Web3Hub/screens/Web3HubSearch/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import { View } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import type { SearchProps } from "LLM/features/Web3Hub/types"; @@ -13,6 +13,11 @@ export default function Web3HubSearch({ navigation }: SearchProps) { const [search, setSearch] = useState(""); const { layoutY, scrollHandler } = useScrollHandler(TOTAL_HEADER_HEIGHT); + // Reset the layoutY value when search changes + useEffect(() => { + layoutY.value = 0; + }, [layoutY, search]); + return (