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

Experiment widget ghost tab #3896

Open
mingyee2 opened this issue Feb 3, 2022 · 2 comments
Open

Experiment widget ghost tab #3896

mingyee2 opened this issue Feb 3, 2022 · 2 comments

Comments

@mingyee2
Copy link

mingyee2 commented Feb 3, 2022

Steps to reproduce

  1. Run through the “15 minutes to QCoDeS tutorial” up to [27]
  2. Click both Snapshot buttons
  3. Click the left snapshot tab
  4. Click the Close Snapshot button

Expected behaviour

The tab closes, leaving behind the second tab created (the second one clicked)

Actual behaviour

The second tab closes, leaving behind an empty “ghost” tab for the first one clicked that cannot be closed (because the tab is now empty)

System

It would be helpful to provide such information:
Windows 10, QCoDeS 0.32.0

@jenshnielsen
Copy link
Collaborator

Thanks for the report. I can reproduce the issue. From reading the docs of ipywidgets its not clear how one is supposed to close a tab. There is also this stack overflow https://stackoverflow.com/questions/69452318/with-ipywidgets-how-to-close-the-tab-containing-the-button-that-is-pressed without an answer

@jenshnielsen
Copy link
Collaborator

I think the problem is that the modification of the tab.children inside the delete method does not work correctly.

e.g. here

tab.children = tuple(c for c in tab.children if c != output)

I have tried replacing this with just output.close() however while this seems to work it now breaks with another error while creating new tabs

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

No branches or pull requests

2 participants