From 9330d9fde5d080dda2d64e1be178c1b2dba89f16 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Thu, 12 Nov 2026 15:43:48 -0500 Subject: [PATCH] Fix horizontal scrollbar in MapLibre layer manager The layer toggle checkboxes used a 100% width plus a 2px margin, so they were 4px wider than the floating sidebar panel and JupyterLab showed a horizontal scrollbar. Use an auto width so the margin fits inside the row. --- leafmap/maplibregl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/leafmap/maplibregl.py b/leafmap/maplibregl.py index 523fddf31a..678d0dd676 100644 --- a/leafmap/maplibregl.py +++ b/leafmap/maplibregl.py @@ -10482,7 +10482,9 @@ def __init__( description="All layers on/off", style=style, indent=False, - layout=widgets.Layout(width="100%"), + # "auto" rather than "100%": the checkbox has a 2px margin, so a + # 100% width overflows the panel and shows a horizontal scrollbar. + layout=widgets.Layout(width="auto"), ) self.master_toggle.observe(self.toggle_all_layers, names="value") @@ -10494,7 +10496,7 @@ def __init__( description=f"{group_name} group layers on/off", style=style, indent=False, - layout=widgets.Layout(width="100%"), + layout=widgets.Layout(width="auto"), ) group_toggle.observe(self.toggle_group_layers, names="value") self.group_toggles.children += (group_toggle,)