Fix prevent default only for submit (#1102)

This commit is contained in:
Nikhil Rao 2023-05-29 22:12:34 -07:00 committed by GitHub
parent 372ee9e943
commit bf93113b26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,11 +281,11 @@ export const isTrue = (val) => {
};
/**
* Prevent the default event.
* Prevent the default event for form submission.
* @param event
*/
export const preventDefault = (event) => {
if (event && event.preventDefault) {
if (event && event.type == "submit") {
event.preventDefault();
}
};