Issues with displaying ipywidgets within a Jupyter Notebook in VS Code #10737
-
Hi! This is an issue that I've encountered recently, but I'm not entirely sure where it originates, so any help identifying it would be appreciated so that I can submit an issue the correct place. It relates to the use of ipywidgets.interactive() within a Notebook in VS Code. I have tested to see that this is not an issue in Jupyter Labs, and I have only recently gotten this problem (so I imagine it relates to an update of either the Jupyter extensions or VS Code itself). The problem is that whatever the first widget is, it will constantly gets focus. This renders e.g. a dropdown menu unusable, as I will not get a chance to choose any of the values before it closes and focus is back on the first widget. The only workaround I could figure out is to make sure the dropdown menu is the very first widget - however, I would not be able to use more than one dropdown menu. Minimal example: import ipywidgets as widgets
from IPython.display import display
def test_func(a=False, b=0):
print(a, b)
w = widgets.interactive(test_func, a=widgets.ToggleButton(value=False), b=widgets.Dropdown(value=0, options=[0,1,2,3,4,5,6]))
display(w) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is caused by a bug in VS Code core, see here microsoft/vscode#151981 |
Beta Was this translation helpful? Give feedback.
This is caused by a bug in VS Code core, see here microsoft/vscode#151981