forms that intentionally reuse a key with mutually exclusive conditionals
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Reproduce the issue with the two mutually exclusive name fields in the report, using a blank submission. Start by tracing the visibility check and clearComponentOnHide() behavior described in the issue, then follow how deleteValue() affects the shared key. Done means entering a valid name no longer clears the shared value or triggers the required-field validation message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
I was using Formio/React 5.3.0 but when I upgraded to 6.2.1 I found that duplicate key reuse for mutually exclusive conditions always throws validation error.
In @formio/react 5.3.0 (formiojs 4), clearOnHide only runs when visibility changes:
if (this.visible !== visible) {
this.visible = visible; // setter may clear
}
Once the edit field is already hidden, later condition checks leave data.name alone, so the create field keeps working.
In @formio/react 6.2.1 (@formio/js 5), every condition check clears a hidden field:
if (this.visible !== visible) {
this.visible = visible;
}
this.clearComponentOnHide(); // always, while hidden
So on create, the hidden edit name repeatedly does deleteValue() on the shared data.name. The create field then fails required, and customMessage makes it look like the pattern error.
below is my two components with the same name but conditional:
{
"key": "name",
"type": "textfield",
"input": true,
"label": "Name",
"disabled": true,
"validate": {
"pattern": "^[a-zA-Z0-9\\s]*$",
"required": true,
"maxLength": 80,
"customMessage": "Invalid name; must contain only letters, numbers or spaces "
},
"autofocus": true,
"tableView": true,
"spellcheck": false,
"showCharCount": true,
"customConditional": "show = data.submissionUuid.length > 0",
"hideOnChildrenHidden": false
},
{
"key": "name",
"type": "textfield",
"input": true,
"label": "Name",
"validate": {
"pattern": "^[a-zA-Z0-9\\s]*$",
"required": true,
"maxLength": 80,
"customMessage": "Invalid name; must contain only letters, numbers or spaces "
},
"autofocus": true,
"tableView": true,
"spellcheck": false,
"showCharCount": true,
"customConditional": "show = data.submissionUuid.length === 0",
"hideOnChildrenHidden": false
}
To Reproduce
Steps to reproduce the behavior:
- create a form with customConditionals has shown above
- use that form with a Form component with no submission data or a blank object.
- on entry of the name you will always get the customMessage.
Expected behavior
I would expect it not to deleteValue() on the shared data.name so we will not get a custom validation message if the text entered is valid.
Screenshots
here is a screen shot of what i with mutually exclusive conditionals
- Lingua principale
- TypeScript
- Stelle
- 371
- Fork
- 309
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di formio/react
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
onChange `modified` property remains false when file component is updatedForse di nuovo libera @ZenMasterJacob20011 l’ha presa 293 giorni fa e non c’è nessuna pull request aperta. Aperta
-
FormBuilder onChange callback not triggered when options prop is providedForse di nuovo libera @Victoriya25 l’ha presa 335 giorni fa e non c’è nessuna pull request aperta. Aperta
-
FormBuilder with OnChange broke textareaForse di nuovo libera @lane-formio l’ha presa 307 giorni fa e non c’è nessuna pull request aperta. Aperta
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
Tutte le issue di formio/react
Issue simili
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
midnightntwrk/platform-js#38 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ranxianglei/billion-context#7068 ·
I maintainer di solito rispondono entro 1 giorno
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ilan-pinto/roaring-lions#1552 ·
I maintainer di solito rispondono entro 1 giorno