| ... | ... | @@ -104,6 +104,7 @@ export function PullRequestSearchInput({ |
| 104 | 104 | busy?: boolean; |
| 105 | 105 | onChange: (value: string) => void; |
| 106 | 106 | }) { |
| 107 | const [draft, setDraft] = useState<string | null>(null); |
| 107 | 108 | return ( |
| 108 | 109 | <InputGroup className="min-w-0 flex-1 **:[input]:h-9 sm:**:[input]:h-8"> |
| 109 | 110 | <InputGroupAddon> |
| ... | ... | @@ -111,8 +112,13 @@ export function PullRequestSearchInput({ |
| 111 | 112 | </InputGroupAddon> |
| 112 | 113 | <InputGroupInput |
| 113 | 114 | type="search" |
| 114 | | value={value} |
| 115 | | onChange={(event) => onChange(event.currentTarget.value)} |
| 115 | value={draft ?? value} |
| 116 | onFocus={() => setDraft(value)} |
| 117 | onBlur={() => setDraft(null)} |
| 118 | onChange={(event) => { |
| 119 | setDraft(event.currentTarget.value); |
| 120 | onChange(event.currentTarget.value); |
| 121 | }} |
| 116 | 122 | placeholder="Search pull requests, or label:bug" |
| 117 | 123 | aria-label="Search pull requests" |
| 118 | 124 | /> |