question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug on handle positioning at 100%

See original GitHub issue

Hi, my first comment on github! If im wrong about this im sorry.

In line 507-508:

// Limit 'to' to 0 - 100 to = to < 0 ? 0 : to > 100 ? 100 : to;

When the handle is moved to the max, the CSS goes something like: left: 100%; because of that conditional.

The problem is that the handle is starting at 100%, so… outside of the container.

Example: If i have a slider bar of 300px width with a handle of 20px width, i expect this:

0% = left: 0px; 50% = (sliderWidth/2 - handleWidth/2) = (300/2 - 20/2) = left: 140px; 100% = (sliderWidth - handleWidth) = (300 - 20) = left: 280px;

However, at 100% the handle is starting at 300px, placing it outside and having a total width of 320px;

I tried to fix it and upload the changes but no success.

Thanks.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:42 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
felixjetcommented, Nov 19, 2013

Can we reopen this and fix it? Its a bug because you expect people to use the default sliders but, since we have the option to use custom sliders, on some cases this bug will happen. My fix is working 100%, the only case where it doesnt work is in vertical sliders, it wouldnt be a problem anyway, but since i dont need them, i didnt waste time adding the fix to them.

But i would like to see this plugin improving !

3reactions
felixjetcommented, Oct 20, 2013

@leongersen How cant it be a bug? In a 3 step slider, it should be 0-50-100%, but the handle is not sitting at 50%, is sitting at a higher value. Because 50% would be marked at the half of the handler, not at the start.

Example

As you see, on a 222px slider, the handler sits out of the slider.

And in the second part of the image, the handler is where it should be, 5px below the blue bar, and 5px below the green bar.

The image is not needed anyway because u got my point.

A solution… well, you say there is no way for the slider to know the handle size, but its specified on the CSS. like:

.noUi-handle { height: 10px; width: 10px; }

so you can read those values just like style = base.data('style'). dont?

Thanks! Awesome slider btw 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug when using absolute position and percentages to ...
In my code img(pretendImage) is width:100%; height:auto and is therefore the same size as div(container) which I wanted div(percents) to be ...
Read more >
Here's How I Solved a Weird Bug Using Tried and True ...
We don't have to be 100% correct in our first try because we'll go step-by-step and form hypotheses that we can test to...
Read more >
Universal Bug-O-Matic | All Position Welding
It has a carrying capacity of 100 lb (45 kg). The carriage also offers six (6) wheel positions for circumferential applications over a...
Read more >
20574 - Fixed-position element uses transformed ancestor as ...
I had this bug and fixed it by using translate3d(-100%, 0, 0) instead of translateX(-100%) and it worked. Comment 47 by schedule jchaffraix@chromium.org ......
Read more >
Finding The Root Cause of a CSS Bug - Ahmad Shadeed
That's expected, and it can be solved by altering the object-position property like so: .card__img { width: 100%; height: 220px; object-fit: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found