Skip to content
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

[ui5-bar]: Buttons in startContent and endContent are cut off when there is long title #11028

Open
1 task done
adrian-bobev opened this issue Mar 7, 2025 · 2 comments
Open
1 task done
Assignees
Labels
bug This issue is a bug in the code TOPIC B

Comments

@adrian-bobev
Copy link
Member

Bug Description

If you have a long title in the bar default slot, the startContent and endContent buttons are cut off

Affected Component

ui5-bar

Expected Behaviour

No cut off

Isolated Example

https://sap.github.io/ui5-webcomponents/play/#eyJpbmRleC5odG1sIjp7Im5hbWUiOiJpbmRleC5odG1sIiwiY29udGVudCI6IjwhLS0gcGxheWdyb3VuZC1mb2xkIC0tPlxuPCFET0NUWVBFIGh0bWw-XG48aHRtbCBsYW5nPVwiZW5cIj5cblxuXG48aGVhZD5cbiAgICBcbiAgICA8c3R5bGU-XG4gICAgICAqOm5vdCg6ZGVmaW5lZCkge1xuICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgICAgfVxuXG4gICAgaHRtbCB7XG4gICAgICBmb3JjZWQtY29sb3ItYWRqdXN0OiBub25lO1xuICAgIH1cbiAgICA8L3N0eWxlPlxuXG4gICAgXG4gICAgPHN0eWxlPlxuICAgICAgKjpub3QoOmRlZmluZWQpIHtcbiAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgIH1cblxuICAgIGh0bWwge1xuICAgICAgZm9yY2VkLWNvbG9yLWFkanVzdDogbm9uZTtcbiAgICB9XG4gICAgPC9zdHlsZT5cblxuICAgIDxtZXRhIGNoYXJzZXQ9XCJVVEYtOFwiPlxuICAgIDxtZXRhIG5hbWU9XCJ2aWV3cG9ydFwiIGNvbnRlbnQ9XCJ3aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MS4wXCI-XG4gICAgPHRpdGxlPlNhbXBsZTwvdGl0bGU-XG48L2hlY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XBvcnQgXCJAdWk1L3dlYmNvbXBvbmVudHMvZGlzdC9UaXRsZS5qc1wiO1xuaW1wb3J0IFwiQHVpNS93ZWJjb21wb25lbnRzL2Rpc3QvQmFyLmpzXCI7XG5pbXBvcnQgXCJAdWk1L3dlYmNvbXBvbmVudHMtaWNvbnMvZGlzdC9ob21lLmpzXCJcbmltcG9ydCBcIkB1aTUvd2ViY29tcG9uZW50cy1pY29ucy9kaXN0L2FjdGlvbi1zZXR0aW5ncy5qc1wiXG4ifX0

Steps to Reproduce

  1. Open the URL

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

latest, did not check others

Browser

Chrome

Operating System

No response

Additional Context

No response

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@adrian-bobev adrian-bobev added the bug This issue is a bug in the code label Mar 7, 2025
@hinzzx hinzzx self-assigned this Mar 12, 2025
@hinzzx hinzzx moved this from New Issues to In Progress in Maintenance - Topic B Mar 12, 2025
@hinzzx
Copy link
Contributor

hinzzx commented Mar 12, 2025

Hello @adrian-bobev,

Since the content of the different parts (startContent, midContent, and endContent) can vary, I recommend setting a minimum width for the startContent and endContent sections. This can be easily achieved by leveraging the CSS ::part() pseudo-element.

For example:

[ui5-bar]::part(endContent) {
    min-width: 2rem;
}

This approach ensures that even if the content changes, the layout remains consistent.

Best regards,
Stoyan

@adrian-bobev
Copy link
Member Author

Hello @hinzzx,

Actually, this won't fully resolve the underlying issue. In our case, we have a button with an icon that has a fixed width. However, the button could also contain translated text, which varies in size depending on the language.

I haven't tested all possible use cases of the bar, but setting min-width: fit-content on the start and end content divs consistently fixes the issue. I believe this adjustment should be handled at the component level rather than by the application itself.

Best regards,
Adrian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code TOPIC B
Projects
Status: In Progress
Development

No branches or pull requests

3 participants