Skip to content

Commit 6fc0a1a

Browse files
committed
Add optional callback for the searchbar button #104
1 parent bd569c6 commit 6fc0a1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SearchBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type SearchBarProps = {
2323
big?: boolean;
2424
classes?: Partial<Record<"root" | "label" | "input", string>>;
2525
style?: CSSProperties;
26+
onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
2627
};
2728

2829
/**
@@ -37,6 +38,7 @@ export const SearchBar = memo(
3738
big = false,
3839
classes = {},
3940
style,
41+
onButtonClick,
4042
...rest
4143
} = props;
4244

@@ -70,7 +72,7 @@ export const SearchBar = memo(
7072
type="search"
7173
id={inputId}
7274
/>
73-
<button className="fr-btn" title="Rechercher">
75+
<button className="fr-btn" title={label} onClick={onButtonClick}>
7476
{label}
7577
</button>
7678
</div>

0 commit comments

Comments
 (0)