mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 09:51:24 +00:00
fix: update search column input on param change (#34951)
This commit is contained in:
parent
b10fde673d
commit
076005eae2
|
@ -1,4 +1,4 @@
|
||||||
import { useCallback, useState, useRef } from 'react';
|
import { useCallback, useState, useRef, useEffect } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
defineMessages,
|
defineMessages,
|
||||||
|
@ -72,6 +72,10 @@ export const Search: React.FC<{
|
||||||
const [expanded, setExpanded] = useState(false);
|
const [expanded, setExpanded] = useState(false);
|
||||||
const [selectedOption, setSelectedOption] = useState(-1);
|
const [selectedOption, setSelectedOption] = useState(-1);
|
||||||
const [quickActions, setQuickActions] = useState<SearchOption[]>([]);
|
const [quickActions, setQuickActions] = useState<SearchOption[]>([]);
|
||||||
|
useEffect(() => {
|
||||||
|
setValue(initialValue ?? '');
|
||||||
|
setQuickActions([]);
|
||||||
|
}, [initialValue]);
|
||||||
const searchOptions: SearchOption[] = [];
|
const searchOptions: SearchOption[] = [];
|
||||||
|
|
||||||
if (searchEnabled) {
|
if (searchEnabled) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user