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

display='none' has no effect with children Accordion's children #741

Closed
hainm opened this issue Aug 29, 2016 · 9 comments
Closed

display='none' has no effect with children Accordion's children #741

hainm opened this issue Aug 29, 2016 · 9 comments
Labels
bug resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@hainm
Copy link

hainm commented Aug 29, 2016

Hi,

Please see below.

acc

Code

tmpnb_ngl.txt

@hainm
Copy link
Author

hainm commented Aug 29, 2016

If I us Tab, I got what I expected (hiding 3rd 'z' widget)

tab

@hainm
Copy link
Author

hainm commented Aug 30, 2016

I am using v5.2.2, not dec version.

@gnestor gnestor closed this as completed Sep 28, 2016
@gnestor gnestor reopened this Sep 28, 2016
@gnestor gnestor added this to the 5.x milestone Sep 28, 2016
@gnestor gnestor self-assigned this Sep 28, 2016
@gnestor gnestor added the bug label Sep 28, 2016
@hainm hainm changed the title display='none' has no effect with of children Accordion's children display='none' has no effect with children Accordion's children Sep 28, 2016
@gnestor
Copy link
Contributor

gnestor commented Oct 24, 2016

widget.children[-1] is a ipywidgets.widgets.widget_output.Output class vs. a ipywidgets.widgets.widget_int.IntSlider, so setting the display value of that will not affect the 3rd slider.

image

So, widget.children[-2].layout.display = 'none' will hide the 3rd slider. I suggest using the visibility property primarily because according to the docs, display "must be equal to ‘flex’ or ‘inline-flex’", although display = 'none' will work.

@hainm
Copy link
Author

hainm commented Oct 24, 2016

@gnestor I meant the behavior is different between using Tab and Accordion. With Tab, I can set display=None while I can not with Accordion. I don't see why they should be different.

There is a reason I want to use display=None in this case: Supposed I have an widget that is about 1/4-1/2 of the notebook. Using visibility does not collapse it if user does not need it, so there will be wasted blank page. Using display=None will collapse that.

@jasongrout
Copy link
Member

This looks like a bug in the Tab widget, that it's hiding the wrong widget. Looks like the bug is already fixed in master, though:

screen shot 2016-10-24 at 1 52 34 pm

Changing the line to widget.children[-2].layout.display='none' works as expected, though, and it hides the z slider.

@jasongrout
Copy link
Member

Closing since it seems to be fixed in master. Please reopen if doing .children[-2] as above doesn't work for you.

@gnestor
Copy link
Contributor

gnestor commented Oct 24, 2016

@jasongrout I can verify that Accordion is not responding to changes to its children's layout. I created a test notebook to reproduce.

image

@gnestor gnestor reopened this Oct 24, 2016
@jasongrout
Copy link
Member

I'll see your screenshot and raise you one of my own notebook :)

screen shot 2016-10-24 at 2 40 51 pm

The accordion you show in your screenshot is not the one we recently merged, I think - the 'Page 0' is blue in the old accordion, but plain black in the new rewrite.

@gnestor
Copy link
Contributor

gnestor commented Oct 24, 2016

You called my bluff! I was wondering why the tabs were still looking like before. Ok, verified that it's currently working as expected master.

@gnestor gnestor closed this as completed Oct 24, 2016
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

3 participants