0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(console): clear search input on clear search results (#4715)

This commit is contained in:
Xiao Yijun 2023-10-23 13:55:57 +08:00 committed by GitHub
parent 6b01e9c88e
commit 19aa36aac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,15 @@ function Search({
/>
<Button title="general.search" onClick={handleClick} />
{isClearable && (
<Button size="small" type="text" title="general.clear_result" onClick={onClearSearch} />
<Button
size="small"
type="text"
title="general.clear_result"
onClick={() => {
setInputValue('');
onClearSearch?.();
}}
/>
)}
</div>
);