This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug
The order of content-tabs is broken if one or more tabs are wrapped within other tags or components. Take a look at the extended unit test.
Problem
Large wizards may use sub components to keep a clear structure and before-change validation. There are issues relating to this, e.g. #247
Explanation
Searching $slots für tab-contents to get an index will fail for nested components as indexOf will return -1:
But there is even a problem with the current implementation and non-nested components. Imagine the following markup:
Array.splice() won't work correctly as the tabs may come up in the following order:
=> The result of using splice with an index is not like desired. The order in which subcomponents are registered is still critical.
Solution
Using Array.push() will still be dependent of the tab registration order but fix the lookup of nested components. Furthermore, adding tabs when they are created instead of mounted may help to be more consistent.
Further improvements
We need to come up with a solution to be independent of component registration order. This way we can also handle dynamically toggled tabs.