I am facing something weird with validation notification if you have a SimpleForm alone (without a Create or Edit tag).
What you were expecting:
See validation message "The form is not valid. Please check for errors" normally a few seconds and then disappear.
What happened instead:
Validation is disappearing so fast, RA/HIDE_NOTIFICATION is firing right after RA/SHOW_NOTIFICATION. If you keep pressed Save button RA/HIDE_NOTIFICATION is not firing, also if you mouseUp outside of Save button (very weird)
Steps to reproduce:
Add a SimpleForm without Create or Edit tag as parent. hit Save button with a required field
Related code:
https://codesandbox.io/s/simple-form-validation-notification-hide-fast-wd8b8
(live app: https://wd8b8.csb.app/#/posts/create, PostCreate.js file, just removed Create tag), go to post create page and hit save a few times.
Also here is the video to see what's happening: https://drive.google.com/open?id=1GprIEnz1YSRD_PiUpys13XBcHcHP9gv2
Environment
I don't know why you use <SimpleForm> without using <Create>. This is neither documented nor supported.
So I don't consider your problem as a bug, please use react-admin as it's documented.
Hi @fzaninotto, I know this is not documented but I would like to explain why I am using a <SimpleForm> without <Create>, it's because I am creating a custom page with a wizard (onboarding) and it's not a simple CRUD, I am overriding save func in order to save content, it's validating ok, it works ok except for the hide notification which is firing right after show notification.
Thanks!
@fzaninotto
I am getting the same behaviour with v3.1.2. I can reproduce the bug with a simplest form:
export const LocationCreate = (props) => (
<Create {...props}>
<SimpleForm variant="outlined">
<TextInput source="code" validate={[required()]} />
</SimpleForm>
</Create>
);
When I click on "Save" just once, the validation triggers and the notification bar disappears instantly. When I double-click on the Save button, the notification bar remains.
Most helpful comment
@fzaninotto
I am getting the same behaviour with v3.1.2. I can reproduce the bug with a simplest form:
When I click on "Save" just once, the validation triggers and the notification bar disappears instantly. When I double-click on the Save button, the notification bar remains.