-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Milestone
Description
Describe the issue. What is the expected and unexpected behavior?
TabContents is rendered using index as Key, instead of the Tab's {eventKey} prop. This causes Content mismatch for a Tab.
Example.
We have 3 tabs ->
Tab 1 -> Title : "Terminal 21", TabContent: "oc get pods"
Tab 2 -> Tiltle: "Terminal 24", TabContent: "This content should have been removed"
Tab 3 -> Title: "Terminal 26", TabContent: "correct content"
Now, If we remove "Tab 2", we get
Tab 1 -> Title : "Terminal 21", TabContent: "oc get pods"
Tab 2 -> Title: "Terminal 26", TabContent: "This content should have been removed"
instead of
Tab 1 -> Title : "Terminal 21", TabContent: "oc get pods"
Tab 2 -> Title: "Terminal 26", TabContent: "correct content"
This occurs as
<TabContent
key={index}
instead of something like
<TabContent
key={child.props.eventKey}
Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.
- Create a Tab using custom eventKey which are not in order/sync with the index.
- Dynamically remove a tab from middle of the array of Tab
- The TabContent is not removed and is simply passed to the next Tab's TabContent
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
Blocking. Bug
What is your product and what release version are you targeting?
Openshift Console 4.11
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done
