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

Accordion: correct height calculated when closed #1536

Closed
wants to merge 5 commits into from

Conversation

apushak
Copy link
Contributor

@apushak apushak commented Apr 13, 2015

Fixes #11938

@apushak
Copy link
Contributor Author

apushak commented Apr 13, 2015

I have no idea why that unit test is failing. All the tests pass when I run them on my machine, so I don't know how I can fix it.

@scottgonzalez
Copy link
Member

Can we get a test for this? heightStyle: "fill" needs to be updated as well.

@@ -361,7 +361,10 @@ return $.widget( "ui.accordion", {
maxHeight = 0;
this.headers.next()
.each( function() {
var display = $( this ).css( "display" );
$( this ).css( "display", "block" );
Copy link
Member

Choose a reason for hiding this comment

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

Just use $( this ).show().

Copy link
Member

Choose a reason for hiding this comment

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

Well, more explicitly, follow this logic:

jquery-ui/ui/dialog.js

Lines 634 to 642 in adcc8ef

// Need to show the dialog to get the actual offset in the position plugin
var isVisible = this.uiDialog.is( ":visible" );
if ( !isVisible ) {
this.uiDialog.show();
}
this.uiDialog.position( this.options.position );
if ( !isVisible ) {
this.uiDialog.hide();
}

@apushak
Copy link
Contributor Author

apushak commented Apr 21, 2015

I've changed it to use is( ":visible" ) and show() / hide(), but that unit test is still failing while it passes if I run it on my machine. It seems like calling show() and hide() causes some change in the element that assert.domEqual detects, but not when I run the test locally.

@scottgonzalez
Copy link
Member

I'm not sure what's going on with that failure either. Can you go ahead with the rest of the changes? I'll try to dig into the Travis failure.

@apushak
Copy link
Contributor Author

apushak commented Apr 23, 2015

I've added a unit test.

heightStyle "fill" uses height() - innerHeight() which just measures padding, and is not effected by the visibility of the element, so no changes should be necessary. I tested this in Chrome, Firefox, and IE.

@@ -10,6 +10,18 @@ var equalHeight = testHelper.equalHeight,

module( "accordion: methods", setupTeardown() );

test( "collapsedHeight", function() {
Copy link
Member

Choose a reason for hiding this comment

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

You're testing a set of options, not a method, so this is in the wrong file and the test title doesn't really make sense.

Copy link
Member

Choose a reason for hiding this comment

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

Add // http://bugs.jqueryui.com/ticket/11938 above the test.

@scottgonzalez
Copy link
Member

The changes and test look good. Just a minor note about the placement of the test. If you'd prefer, I can make that change myself when I land this. Otherwise, I'll just wait to hear back from you. Thanks.

@scottgonzalez
Copy link
Member

Also, we still have no idea why that test is failing in Travis, but we'll keep digging.

@scottgonzalez
Copy link
Member

Can you rebase on master and see if that helps at all with Travis? It's a clean rebase, I tested locally.

@apushak
Copy link
Contributor Author

apushak commented Apr 24, 2015

I did a rebase on master which did not fix the Travis issue. I also moved and renamed the unit test.

@scottgonzalez
Copy link
Member

I'm still trying to figure out what's causing the test to fail. So far I've tracked it down to this difference:

< "WebkitTransformOrigin": "500px 22px",
> "WebkitTransformOrigin": "492px 22px",
< "WebkitPerspectiveOrigin": "500px 22px",
> "WebkitPerspectiveOrigin": "492px 22px",
< "width": "1000px",
> "width": "984px",
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Oct 15, 2015
scottgonzalez pushed a commit to scottgonzalez/jquery-ui that referenced this pull request Feb 9, 2016
@scottgonzalez
Copy link
Member

It's been almost a year, so you've probably forgotten about this by now. But I have good news! We just upgraded to Phantom 2 and the tests now pass on Travis.

scottgonzalez pushed a commit that referenced this pull request Jun 9, 2016
Fixes #11938
Closes gh-1536
Closes gh-1616

(cherry picked from commit c87653b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants