Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa92537404 | |||
| 27d37d8e7e |
@@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import React, { useEffect } from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { ISubmitEvent, IChangeEvent, ErrorSchema } from "@rjsf/core";
|
import { ISubmitEvent, IChangeEvent, ErrorSchema } from "@rjsf/core";
|
||||||
import colors from "@theme/colors";
|
import colors from "@theme/colors";
|
||||||
@@ -44,6 +44,17 @@ type AdminCreateCommonProps = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// removes item focus if scrolled
|
||||||
|
const onWheelEvent = (e) => {
|
||||||
|
try {
|
||||||
|
if (e.target.type === "number") {
|
||||||
|
e.target.blur()
|
||||||
|
}
|
||||||
|
} catch(error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
|
const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
|
||||||
title,
|
title,
|
||||||
formData,
|
formData,
|
||||||
@@ -60,6 +71,14 @@ const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
|
|||||||
console.error(data);
|
console.error(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
try {
|
||||||
|
document.addEventListener('wheel',onWheelEvent);
|
||||||
|
} catch(error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminPageWrapper requiresAuthentication>
|
<AdminPageWrapper requiresAuthentication>
|
||||||
<Common>
|
<Common>
|
||||||
|
|||||||
Reference in New Issue
Block a user