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.

Cannot create a widget whose initial state is visible=False

See original GitHub issue

In ipywidgets 5.2.2 the code below produces a widget that is visible:

check = Checkbox(description="A box", visible=False)
check

In ipywidgets 4, the checkbox wouldn’t be displayed until I later set check.visible = True.

While this minimal example is pretty silly, I do rely heavily on being able to construct a widget with some components not visible until the user interacts with other elements.

A workaround or fix would be great.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:25 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
vidartfcommented, Jul 4, 2017

Both title and select use the same instance of Layout, and both widgets are used twice (it shows the same Label and SelectMultiple twice, not copies). In short, all the (non-box) widgets have the exact same instance of box_layout. Try creating one layout for each widget (and probably multiple value widgets).

1reaction
jasongroutcommented, Jul 3, 2017

Can you post some code reproducing this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ipywidget interactive hiding visibility - python - Stack Overflow
... from here Cannot create a widget whose initial state is visible=False ... button.layout.visibility = "hidden" # Make the widget visible ...
Read more >
Possible bug with window using Visible(false) - Telerik
If you default the visible state to false the window as well as the content get styled to display:none. It seems like the...
Read more >
ipywidget interactive hiding visibility - DevPress - CSDN
Answer a question I would like to make an interactive module with ... from here Cannot create a widget whose initial state is...
Read more >
Python – ipywidget interactive hiding visibility - iTecNote
I want to hide the visibility of a certain ipywidget object dependent on a ... got if from here Cannot create a widget...
Read more >
Building Interactive Figma Widgets | CSS-Tricks
We must add state to our widget, which all React developers know is a variable whose change triggers the re-rendering of our component....
Read more >

github_iconTop Related Medium Post

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