marmelab / marmelab/react-admin

Form refresh issue after edit

Open
#9,327 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
26.9k
Forks
5.5k
Avg merge
2d 3h
Merged PRs (30d)
19

Description

Hello, i've an issue when I edit a record :
If I delete an existing field value, save form and just after, modify another field and save form again,
my previous field to which I deleted the value, returns to its previous value.
When form is refreshed after save, If I check the React Query dev tool, the data are however good
It's occurs only when field value was previously set to null
Little precision : I use Airtable as database, and records fields that are null are not retrieved from the record data

**Steps to reproduce:**

- Select a record from post list
- if "Name" input was empty, add value, save form, and refresh stackblitz render window
- delete "Name" value
- save form
- change value of checkbox
- save form

- [https://stackblitz.com/edit/github-iq4gf4?file=src%2Fposts%2FPostEdit.tsx,src%2FdataProvider.tsx,src%2Fposts%2FPostList.tsx](https://stackblitz.com/edit/github-iq4gf4?file=src%2Fposts%2FPostEdit.tsx,src%2FdataProvider.tsx,src%2Fposts%2FPostList.tsx)

**Environment**

* React-admin version: 4.14.4
* Last version that did not exhibit the issue : 3.11.3 (yeah big jump 😅)
* React version: 17.0.0
* Browser: Chrome, Safari, Firefox

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz files: src/posts/PostEdit.tsx, src/dataProvider.tsx, and src/posts/PostList.tsx. Reproduce the null-value edit sequence and compare the form refresh with the React Query dev-tool data, focusing on how Airtable omits null fields. Done means a deleted value remains empty after a later field edit and save.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.