-
Notifications
You must be signed in to change notification settings - Fork 184
ipywidget Accordion not working properly #677
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Here's a simple example of a label within an Accordion widget working in an ipyleaflet Map in a Jupyter notebook:
import ipyleaflet
import ipywidgets as widgets
label = widgets.Label("General Kenobi!")
accordion = widgets.Accordion(children=[label], titles=['Hello there!'])
m = ipyleaflet.Map()
toolbar = ipyleaflet.WidgetControl(widget=accordion,
position="topright",
)
m.add(toolbar)
mClosed accordion
Open
Here's the corresponding code for Solara:
import solara
import ipyleaflet
import ipywidgets as widgets
zoom = solara.reactive(6)
center = solara.reactive((0,0))
class Map(ipyleaflet.Map):
def __init__(self, **kwargs):
super().__init__(**kwargs)
label = widgets.Label("General Kenobi!")
accordion = widgets.Accordion(children=[label], titles=['Hello there!'])
toolbar = ipyleaflet.WidgetControl(widget=accordion,
position="topright",
)
self.add(toolbar)
@solara.component
def Page():
with solara.Column() as main:
map = Map.element( # type: ignore
zoom=zoom.value,
on_zoom = zoom.set,
center=center.value,
on_center=center.set,
scroll_wheel_zoom=True,
toolbar_ctrl=False,
data_ctrl=False,
)
return mainUnfortunately, the accordion widget does not close:
Heres my information on Solara, ipyleaflet, and ipywidgets versions:
Solara version: 1.33.0
ipyleaflet version: 0.19.1
ipywidgets version: 8.1.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working


