Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-tabs] Deselection of Tab Issue #2144

Merged
merged 3 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/terra-tabs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Fixed
* Fixes for deselection of tab within more button.
* More button dropdown left position reset to zero when negative.

## 7.28.0 - (April 23, 2024)

* Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/terra-tabs/src/common-tabs/_Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class Tabs extends React.Component {
offset = parentOffset + leftEdge + widthDelta;
}

this.dropdownRef.current.style.left = `${offset}px`;
this.dropdownRef.current.style.left = (offset > 0) ? `${offset}px` : '0px';
// Dropdown menu gets truncated when the left edge is less than or equal to zero. setting min-width will help to fix this issue.
if (!leftEdge) {
this.dropdownRef.current.style.minWidth = `${moreRect.width}px`;
Expand All @@ -439,7 +439,7 @@ class Tabs extends React.Component {
if (this.isOpen) {
const updatedTabData = this.state.visibleTabData.map((tab) => ({
...tab,
isSelected: tab.id === itemKey,
isSelected: tab.itemKey === itemKey,
}));
this.setState({ visibleTabData: updatedTabData }, () => {
onSelect(itemKey, metaData);
Expand Down
Loading