We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64098a5 commit c93b4ebCopy full SHA for c93b4eb
src/components/Button/index.tsx
@@ -8,16 +8,16 @@ export interface IProps extends ButtonProps {
8
}
9
10
const Button: React.FC<IProps> = ({ toId, children, ...props }) => {
11
- const handleOnClick = () => {
12
- if (!toId) {
13
- return
+ const handleOnClick = (e: React.MouseEvent<HTMLButtonElement>) => {
+ if (toId) {
+ scrollIntoView(toId)
14
15
16
- scrollIntoView(toId)
+ props.onClick?.(e)
17
18
19
return (
20
- <ChakraButton onClick={handleOnClick} {...props}>
+ <ChakraButton {...props} onClick={handleOnClick}>
21
{children}
22
</ChakraButton>
23
)
0 commit comments