surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4k stars 780 forks source link

Dynamic Panel (Tab) wrongly switch panel when some panels are hidden #8430

Open zvn2060 opened 1 week ago

zvn2060 commented 1 week ago

Are you requesting a feature, reporting a bug or asking a question?

bug

What is the current behavior?

When dynamic panel render as tab { "renderMode": "tab" } and some of its panel was hidden by templateVisibleIf

click the tabs which are after hidden tab, doesn't jump to correct tab.

Like, the logic still consider all panels are visible.

What is the expected behavior?

It should jump to correct panel

How would you reproduce the current behavior (if this is a bug)?

In below repro size, the survey is filled with answer, where the question2: 2 was config to hidden and click tab (value: 3), it will jump to value: 4 tab

{
  question1: [
    { question2: 1 },
    { question2: 2 },
    { question2: 3 },
    { question2: 4 },
  ],
}

CodeSandbox

Provide the test code and the tested page URL (if applicable)

Specify your Environment