-
-
Notifications
You must be signed in to change notification settings - Fork 171
Fix BTabs initial index ignored when tabs don't have id props - Work in Progress #2847
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
base: main
Are you sure you want to change the base?
Conversation
|
|
Co-authored-by: xvaara <130606+xvaara@users.noreply.github.com>
Co-authored-by: xvaara <130606+xvaara@users.noreply.github.com>
…tion Co-authored-by: xvaara <130606+xvaara@users.noreply.github.com>
commit: |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
@copilot the tests are failing. |
…eeded Co-authored-by: xvaara <130606+xvaara@users.noreply.github.com>
I can see the failing test. The issue is in the BTabs component where the initial index prop is being ignored when tabs don't have explicit IDs. The activeId watcher is firing during initialization and resetting the activeIndex to 0 instead of respecting the user-provided initial value of 2. I've identified the root cause and am working on a fix. The challenge is that the activeId watcher needs to handle the timing of when activeId is undefined during initialization without overriding user-provided initial indices. Working on commit ea4fdc9 to address this. |
…but test still failing Co-authored-by: xvaara <130606+xvaara@users.noreply.github.com>
|
This PR is stale because it has been open for 45 days with no activity. It will not be auto-closed |
The BTabs component was ignoring the initial
indexprop when tabs didn't have explicitidprops defined, always defaulting to the first tab instead of respecting the user's intended starting position.Problem:
Root Cause:
The issue was identified in the
activeIdwatcher which would resetactiveIndexto the first enabled tab whenever it couldn't find a tab with the specified ID, even when the user had provided a valid initial index. This happened because:activeIndex: 2from v-modelactiveIdgets set based on temporary tab IDsactiveIdwatcher fires, can't find the tab (due to timing), and resetsactiveIndexto 0Current Status:
Multiple attempts have been made to fix the
activeIdwatcher logic, including:activeIdwatcher logic to validate currentactiveIndexbefore overriding itactiveIndex < 0However, the test case continues to fail, suggesting the issue may be more complex than initially identified. The problem might involve:
activeIdwatcherChanges Made:
activeIdwatcher to include guard against resetting valid initial indicesNext Steps:
Further investigation is needed to identify the exact source of the index reset during component initialization.
Fixes #2773.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.