Skip to content

fix(ui5-tabcontainer): update tabs in strip properly #11235

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kskondov
Copy link
Contributor

@kskondov kskondov commented Apr 1, 2025

tabs no longer change position when selected
Fixes: #11087

tabs no longer change position when selected
Fixes: #11087
@kskondov kskondov requested a review from a team April 1, 2025 12:49
@@ -1115,6 +1133,9 @@ class TabContainer extends UI5Element {
}

_hasStartOverflow(containerWidth: number, itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, selectedItemIndexAndWidth: { width: number; index: number}) {
if (this._getStartOverflow().textContent !== "+0") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is needed.

@@ -990,11 +990,28 @@ class TabContainer extends UI5Element {
let allItemsWidth = 0;

const itemsDomRefs = this.items.map(item => item.getDomRefInStrip()) as Array<TabInStrip | TabSeparatorInStrip>;
let allVisibleItemsWidth = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move all of the new logic to the _updateStartAndEndOverflow method, as it is valid only for this case.

@kskondov kskondov requested review from TeodorTaushanov and a team April 11, 2025 10:36
Copy link
Contributor

@dimovpetar dimovpetar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ui5-tabcontainer]: tab changes position when selected
3 participants