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

Slider labels cause a horizontal scrollbar #9908

Open
1 task done
brandon-sap opened this issue Sep 19, 2024 · 1 comment
Open
1 task done

Slider labels cause a horizontal scrollbar #9908

brandon-sap opened this issue Sep 19, 2024 · 1 comment
Labels
bug This issue is a bug in the code Low Prio TOPIC RL

Comments

@brandon-sap
Copy link
Member

brandon-sap commented Sep 19, 2024

Bug Description

The issue varies depending on the particulars of min, max, and label-interval. Maybe some other things on occasion.


Additional notes:

From inspecting the makeup of the web component in its shadow DOM, the cause is that the labels are made to take up more than 100% of the width. For my case, I have a slider with min=1, max=4, label-interval=1. With this, there are 4 labels, each getting 33.3333% of the space. Then the element is moved with a left: -16.6667%. This makes sense, and lines the labels up with the tick marks correctly, but it still creates an element that takes up more than 100% of the space available.

I also noticed that the tick marks are similarly correctly spaced, but they are done with a different mechanism. They use display: flex and then justify-content: space-between. This has the same effect without creating an element that takes up too much space. I think it would make sense to use the same construct for the labels.

Along those lines, I think it makes sense, when you have 2 things like this that aren't directly connected and need to line up, to use the same mechanism for alignment. So between the ticks and their labels, constructing them in the same way would make sense. And the display: flex; justify-content: space-between definitely works better than the percent widths and sliding the element left. Just my 2 cents.

Affected Component

Slider

Expected Behaviour

No scrollbar. When width is set to 100%, the slider should take all the space and not cause a horizontal scrollbar.

Isolated Example

Playground Example

Steps to Reproduce

playground example

  1. Go to the isolated example, observe scrollbar.

The docs also have the same issue, here: https://sap.github.io/ui5-webcomponents/components/Slider/#more-samples

  1. The first example has 2 sliders in it. One causes the scrollbars.

Log Output, Stack Trace or Screenshots

No response

Priority

Low

UI5 Web Components Version

2.2.0

Browser

Chrome

Operating System

Windows 11

Additional Context

No response

Organization

SAP

Declaration

  • I’m not disclosing any internal or sensitive information.
@brandon-sap brandon-sap added the bug This issue is a bug in the code label Sep 19, 2024
@IlianaB
Copy link
Member

IlianaB commented Sep 20, 2024

Hello @SAP/ui5-webcomponents-topic-rl , please have a look at this issue about Slider. When width is set to 100%, the slider should take all the space and not cause a horizontal scrollbar.

Regards,
Iliana

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 Low Prio TOPIC RL
Projects
Status: New Issues
Development

No branches or pull requests

2 participants