forms that intentionally reuse a key with mutually exclusive conditionals
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 371
- Forks
- 309
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de formio/react
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
onChange `modified` property remains false when file component is updatedQuizá libre de nuevo @ZenMasterJacob20011 la tomó hace 293 días y no hay ningún pull request abierto. Abierto
-
FormBuilder onChange callback not triggered when options prop is providedQuizá libre de nuevo @Victoriya25 la tomó hace 335 días y no hay ningún pull request abierto. Abierto
-
FormBuilder with OnChange broke textareaQuizá libre de nuevo @lane-formio la tomó hace 307 días y no hay ningún pull request abierto. Abierto
-
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
Todos los issues de formio/react
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel-labs/ui#809 ·
Los mantenedores suelen responder en 1 día
-
bot:ai-assisted component:platform-js status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
midnightntwrk/platform-js#38 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-reviewPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ranxianglei/billion-context#7068 ·
Los mantenedores suelen responder en 1 día
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mybigday/whisper.rn#348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
six-group/six-webcomponents#600 ·