Troubleshooting unsaved changes indicator BOD-172
This commit is contained in:
@@ -6,14 +6,17 @@ import { Prompt, useLocation } from "react-router-dom";
|
||||
|
||||
export default function FormsFieldChanged({ form }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const loc = useLocation();
|
||||
|
||||
return (
|
||||
<Form.Item shouldUpdate style={{ margin: 0, padding: 0 }}>
|
||||
{() => {
|
||||
console.log("Render", form.isFieldsTouched());
|
||||
if (form.isFieldsTouched())
|
||||
return (
|
||||
<div>
|
||||
@@ -26,7 +29,7 @@ export default function FormsFieldChanged({ form }) {
|
||||
}}
|
||||
/>
|
||||
<AlertComponent
|
||||
type='warning'
|
||||
type="warning"
|
||||
message={
|
||||
<div>
|
||||
<span>{t("general.messages.unsavedchanges")}</span>
|
||||
@@ -35,7 +38,8 @@ export default function FormsFieldChanged({ form }) {
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
textDecoration: "underline",
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("general.actions.reset")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user