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 { ISubmitEvent, IChangeEvent, ErrorSchema } from "@rjsf/core";
|
||||
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> = ({
|
||||
title,
|
||||
formData,
|
||||
@@ -53,13 +64,21 @@ const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
|
||||
onFocus,
|
||||
onSubmit,
|
||||
error,
|
||||
widgets,
|
||||
widgets,
|
||||
}) => {
|
||||
const onError = (data: unknown) => {
|
||||
console.error("error, data:");
|
||||
console.error(data);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
document.addEventListener('wheel',onWheelEvent);
|
||||
} catch(error) {
|
||||
console.log(error)
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AdminPageWrapper requiresAuthentication>
|
||||
<Common>
|
||||
|
||||
Reference in New Issue
Block a user