diff --git a/folium/map.py b/folium/map.py index d6d0a7483b..0169cd1543 100644 --- a/folium/map.py +++ b/folium/map.py @@ -483,8 +483,8 @@ def __init__( self.lazy = lazy self.options = dict( max_width=max_width, - autoClose=False if show or sticky else None, - closeOnClick=False if sticky else None, + autoClose=not (show or sticky), + closeOnClick=not sticky, **kwargs, ) diff --git a/tests/test_map.py b/tests/test_map.py index 7104971a68..440c9012a9 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -134,7 +134,7 @@ def test_popup_show(): rendered = popup._template.render(this=popup, kwargs={}) expected = """ var {popup_name} = L.popup({{ - "maxWidth": "100%","autoClose": false,"closeOnClick": null, + "maxWidth": "100%","autoClose": false,"closeOnClick": true, }}); var {html_name} = $(`