Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Clone not working with a TabbedForm on the Create component

Aperta
#10,678 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con il repository di riproduzione ra-tabbedform-clone, in particolare CloneStateButton e il componente PostCreate che utilizza TabbedForm, e confronta il suo comportamento con la configurazione più recente di react-admin descritta nell’issue. Riproduci il flusso di clonazione modificando il titolo, passando da General a Misc e tornando indietro, quindi verifica che le modifiche rimangano preservate quando torni alla prima scheda.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs more info v4

What you were expecting:

When cloning a resource, a tabbed create form shows all the values from the original record (except the omitted id). And when changes the values in that create form, the changes are kept even when switching tabs.

What happened instead:

The create form looks ok, it shows the values of the cloned record. However when changing prefilled values on tab 1 and navigate to tab 2. When you go back to tab 1, the changes are gone.

Steps to reproduce:

  • Go to posts resource
  • Click on a post
  • Click "Clone" button
  • Fill in the "id" field (which is empty because omitted in the clone)
  • Change the "title" (which was prefilled with value of cloned record)
  • Switch to second tab "Misc" of the create form by clicking on that tab
  • Go back to first tab "General" by clicking on that tab
  • Note that "id" is still filled in
  • Note that "title" changes are gone... it is back to it's original value of the cloned record. ==> bug
  • Change the "title" again
  • Switch to second tab and back to first tab again
  • Note that this second time the "title" changes are still there

Related code:

  • Started from the basic react-admin app via npx [email protected] ra-tabbedform-clone
  • Added a CloneStateButton to clone via location.state instead of via search
  • Made a simple PostEdit component
  • Made a simple PostCreate component that uses TabbedForm

Other information:

Only related issue I found is from the v3 version: https://github.com/marmelab/react-admin/issues/4066

Tried to reproduce this on latest react-admin v5.7.2 via npx create-react-admin@latest ra-tabbedform-latest --data-provider fakerest --resource posts. But there it seems to work.

Using the regular CloneButton this problem does not occur. However, that uses the location search and I do not want my complete record state in the URL. The docs state "In general, using the location state is a safe bet."

Environment

  • React-admin version: 4.16.20
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18.3.1
  • Browser: Chrome Version 131.0.6778.265 (Official Build) (64-bit)
  • Stack trace (in case of a JS error):
Lingua principale
TypeScript
Stelle
27k
Fork
5.5k
Merge medio
1g 3m
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di marmelab/react-admin

Tutte le issue di marmelab/react-admin

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.