Skip to content

Slider: Range fills all space after changing orientation #1533

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

Closed
wants to merge 5 commits into from
Closed

Slider: Range fills all space after changing orientation #1533

wants to merge 5 commits into from

Conversation

atomiomi
Copy link
Contributor

@atomiomi atomiomi commented Apr 7, 2015

Resets width/height of range

@atomiomi
Copy link
Contributor Author

atomiomi commented Apr 7, 2015

For example let's take max range slider. If orientation is changed from horizontal to vertical then the range will fill horizontal space proportionally to value of handle before changing. I reproduced this bug with 1.10 and 1.11 version of jQuery UI in Chrome and Firefox.

Test link: http://jsfiddle.net/f52g9u47/4/. To reproduce this bug follow this steps:

  1. Change orientation to vertical. Everything is ok. Change it back to horizontal.
  2. Drag the handle to the middle of the track.
  3. Set orientation to vertical
  4. Now range doesn't fill all space. If you change orientation back to horizontal, range will also fill only half vertical space.

It works in min and simple range too.

@atomiomi
Copy link
Contributor Author

atomiomi commented Apr 7, 2015

I didn't create a ticket because of following error: "Maximum number of posts per hour for this IP". I'll create it after a while.

Reset range's left/bottom position
@@ -440,7 +440,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
._addClass( "ui-slider-" + this.orientation );
this._refreshValue();

this._refreshRange( value );
Copy link
Member

Choose a reason for hiding this comment

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

Please restore this blank line, it's required by our style guide (all comments must be preceded by a blank line).

@scottgonzalez
Copy link
Member

Can you try filing the ticket again?

@atomiomi
Copy link
Contributor Author

http://bugs.jqueryui.com/ is unavailable, I'll try later

@scottgonzalez
Copy link
Member

The server is back up.

@atomiomi
Copy link
Contributor Author

For some reason system created two tickets, one of them should be removed: #12205, #12206 (better to remove the second one due to #12205 is specified in the last commit)

@atomiomi
Copy link
Contributor Author

I corrected tests. What additional test for height of vertical slider and for width of horizontal slider did you mean? Or I misunderstood you

@scottgonzalez
Copy link
Member

The range is controlled in two directions. Right now only one dimension is checked per orientation. The test should confirm that both dimensions are adjusted properly.

@atomiomi
Copy link
Contributor Author

Ooh I got it, but how for example width of range of horizontal slider should be calculated? My proposition: also specify the slider width then set the value and calculate the range width according to the total width and slider value

@scottgonzalez
Copy link
Member

Sounds good.

Wrote additional tests for range dimensions

Fixes #12205
@atomiomi
Copy link
Contributor Author

Tests are done. It's strange that Travis doesn't check the new commit, isn't it?

@scottgonzalez
Copy link
Member

They're working through some issues: http://www.traviscistatus.com/

@scottgonzalez
Copy link
Member

Thanks, this looks good now.

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

Successfully merging this pull request may close these issues.

3 participants