mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
SubmitButton: scroll to top after performing action
This commit is contained in:
@@ -4,12 +4,16 @@ import Button, { type ButtonProps } from "./Button";
|
||||
|
||||
class SubmitButton extends React.Component<ButtonProps> {
|
||||
render() {
|
||||
const { action } = this.props;
|
||||
return (
|
||||
<Button
|
||||
type="submit"
|
||||
color="primary"
|
||||
{...this.props}
|
||||
action={() => {
|
||||
action={(event) => {
|
||||
if (action) {
|
||||
action(event)
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user