Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non paginated loop : controls are not displayed if loop dimension is "static" #1152

Open
2 of 6 tasks
QRuhier opened this issue Sep 20, 2024 · 2 comments
Open
2 of 6 tasks
Assignees
Labels
Type: Bug Something isn't working

Comments

@QRuhier
Copy link
Contributor

QRuhier commented Sep 20, 2024

Describe the bug

When setting a non paginated loop with a fixed value of min/max number of iterations (even if it is defined by an external variable) , controls are not displayed.

There is no problem if the dimension is defined by a non static value (collected, calculated with real calculation...).

The problem is present, with and without Question component.

  • I tested it on the storybook, which leads me to believe that it's a lunatic bug.

To Reproduce

Steps to reproduce the behavior:

working.json
not_working.json

Expected behavior

Controls should be displayed in non paginated loop whatever how we define the number of iterations

Screenshots

Version where the bug appeared

Browser where the bug was tested

  • Chrome
  • Firefox
  • Safari
  • Edge
  • Other (please specify): ___

Additional context

Add any other context about the problem here.

@QRuhier QRuhier added the Type: Bug Something isn't working label Sep 20, 2024
@QRuhier
Copy link
Contributor Author

QRuhier commented Sep 20, 2024

@Grafikart First explanation :

  • loop for which the number of iteration is defined by a fixed value :

    • the collected value of the variables in the loop is [] , so if you by-pass the question the control is not triggered because the dimension is not correct
    • if you set for example only the value for the 2th iteration (even if there are 3 iterations), you will have [null, 'toto'] so the control can be triggered only for the 2 first iterations, because the dimension is not correct
  • loop for which the number of iteration is defined by a collected value :

    • before setting this collected value, the collected value of the variables in the loop is []
    • after setting this collected value (let's say 2), the collected value of the variables in the loop become [null, null], so when being in this loop the control can be triggered for every iteration because the dimension is correct

@Grafikart Grafikart self-assigned this Sep 24, 2024
@Grafikart
Copy link
Collaborator

@QRuhier Pas évident celui là. Je dirais que la bonne solution dans un cas de boucle fixe serait d'initialiser la variable avec la bonne taille

{
	"name": "PRENOMS",
	"values": {
		"EDITED": [],
		"FORCED": [],
		"INPUTTED": [],
		"PREVIOUS": [],
		"COLLECTED": [null, null, null]
	},
	"dimension": 1,
	"variableType": "COLLECTED",
	"iterationReference": "m0nk8xx7"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants