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

Breaking change in page count when questionsOnPageMode is questionPerPage #9682

Closed
gfWise opened this issue Apr 3, 2025 · 1 comment
Closed
Labels

Comments

@gfWise
Copy link

gfWise commented Apr 3, 2025

Describe the bug
From version 1.12.16 the behaviour of page related indexes and totals has changed when questionsOnPageMode is questionPerPage.
In version 1.12.15 the pageCount is the number of pages displayed (usually the total number of questions not considering edge cases, e.g. panels), while in version 1.12.16 the pageCount is the number of pages in the survey.
Similarly when listening to the event onCurrentPageChanged the index of the new page is always different in version 1.12.15 while in version 1.12.16 could be the same (when two questions belong to the same page in the survey definitions)

Steps to reproduce
I reproduced the issue using a test survey with 3 pages where each page has 2 questions. I prepared these 2 minimal code sandboxes to illustrate the issue:

You can see that in the 1.12.15 the pageCount is 6 and the visibleIndex changes each time the user moves to the next question, while in the 1.12.16 pageCount is 3 and the visibleIndex only changes when moving to a question of the next page in the survey definitions.

Expected behaviour
To me the expected behaviour should be the one of the 1.12.15 because when using mode questionPerPage the structure of the survey actually changes from the one described in the schema. Also it was very handy to know which step of the survey the user is seeing.

Please complete the following information:

  • JS framework/library: React

Additional context
In case the expected behaviour is the one of 1.12.16, how can I track the progress of the user when the survey is presented in questionPerPage mode?

If you need any other info please let me know
Thank you!

@JaneSjs JaneSjs self-assigned this Apr 7, 2025
@JaneSjs JaneSjs added the user issue An issue or bug reported by users label Apr 7, 2025
@JaneSjs JaneSjs removed their assignment Apr 7, 2025
@andrewtelnov
Copy link
Member

andrewtelnov commented Apr 7, 2025

@gfWise We have refactored the code and it works differently now. We do not recreate any pages and so on. You will still have the same original pages structure. We are not going to change it back since the current implemation is fast and solves many issues.
The main idea, we are showing just one question per page in this mode and hide all other elements on the page. As result it works super fast and we don't need to change pages structure on the fly. The old behavior works slow with many questions.
You can use survey.currentSingleElement writable property to get the current visible question.

Thank you,
Andrew

@JaneSjs JaneSjs added question and removed user issue An issue or bug reported by users labels Apr 8, 2025
@JaneSjs JaneSjs closed this as completed Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants