refactor: change form handler on ExportOptionsModal#4207
refactor: change form handler on ExportOptionsModal#4207Sebastien-Ahkrin wants to merge 10 commits into
Conversation
Deploying nmrium with
|
| Latest commit: |
4ee3e06
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fc2cae2c.nmrium.pages.dev |
| Branch Preview URL: | https://4172-refactor-useform-on-exp.nmrium.pages.dev |
|
I suggest you take care of #4215 in a separate PR to unblock this. |
There was a problem hiding this comment.
Advanced Mode looks broken
Height, Width and Unit are empty.
This forms reminds me this one:
I suggest you to refactor / re-use part of this form or copy-paste it. It is working properly even in advanced mode.
src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx
I hope the data-struct is the same so you can simply re-use the field-group.
This one also use setFieldValue, but with dontRunListeners: true option. without it, editing values was slow, editing width edit height, and height edit the width. it loop until conversion between both was stable (or tanstack have a kill-switch to stop this kind of infinite edit-loop). So I predict your current implementation have this issue.
|
It should be the same data-struct. Or at least compatible with
Both should looks and behave exactly the same. Both forms edit |
tpoisseau
left a comment
There was a problem hiding this comment.
After you took into account my last comment, you are good to merge.
| <StyledDialogBody> | ||
| <ExportFields form={form} fields="values" /> | ||
| </StyledDialogBody> | ||
| <DialogFooter> |
There was a problem hiding this comment.
I did not notice before your screens but you should use actions props of DialogFooter instead of children.
children is for extra content, left align. actions is for, well, actions, right align.
Also, actions take care of align and spacing. You just have to put a fragment with Buttons inside in it.




Closes: #4172