From 9df67e0c7429143d616757d0ef9c81122a320019 Mon Sep 17 00:00:00 2001 From: PGray <77597544+PGrayCS@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:25:38 +0100 Subject: [PATCH] [Glitch] fix: update search column input on param change Port 076005eae29d623b5bd68f660c4e2d9da50abda8 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/compose/components/search.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/search.tsx b/app/javascript/flavours/glitch/features/compose/components/search.tsx index 97ab67c6c2..cb94930ffc 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.tsx +++ b/app/javascript/flavours/glitch/features/compose/components/search.tsx @@ -1,4 +1,4 @@ -import { useCallback, useState, useRef } from 'react'; +import { useCallback, useState, useRef, useEffect } from 'react'; import { defineMessages, @@ -72,6 +72,10 @@ export const Search: React.FC<{ const [expanded, setExpanded] = useState(false); const [selectedOption, setSelectedOption] = useState(-1); const [quickActions, setQuickActions] = useState([]); + useEffect(() => { + setValue(initialValue ?? ''); + setQuickActions([]); + }, [initialValue]); const searchOptions: SearchOption[] = []; if (searchEnabled) {