ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

Dropdown tooltips don't appear if description is set

Open nbastin opened this issue 11 months ago • 0 comments

Dropdown widgets display a tooltip (or at least have a title set in the select tag - what the browser does is up to the browser) as long as you don't set the description attribute in the code:

widgets.Dropdown(options=["one", "two"], tooltip="foo")

results in

<select id="849cda15-51eb-418e-a850-e437416aaf1c" title="foo"><option data-value="one" value="one">one</option><option data-value="two" value="two">two</option></select>

but if you set the description to force a label, then you get no tooltip on either the label or the select box itself:

widgets.Dropdown(options=["one", "two"], tooltip="foo", description="bar")

generates:

<div class="lm-Widget jupyter-widgets widget-inline-hbox widget-dropdown"><label class="widget-label" style="" for="2af4135d-ead3-452c-bb33-c20409c7101b">bar</label><select id="2af4135d-ead3-452c-bb33-c20409c7101b"><option data-value="one" value="one">one</option><option data-value="two" value="two">two</option></select></div>

This is with ipywidgets 8.1.5, and jupyterlab 4.2.4 (no extensions).

nbastin avatar Nov 07 '24 02:11 nbastin