mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-23 16:35:07 +00:00
fix: page scrolls up on form submisssion
This commit is contained in:
6
frontend/src/lib/utils/event-util.ts
Normal file
6
frontend/src/lib/utils/event-util.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function preventDefault(fn: (event: Event) => void): (event: Event) => void {
|
||||
return function (this: unknown, event) {
|
||||
event.preventDefault();
|
||||
fn.call(this, event);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user