You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have found an issue with Typescript support in the latest version. It boils down to an extra letter (or maybe one less than enough?)
In the vanilla module when you add a panel you set the 'pane' field, yet in the Typescript definition it is the 'panel' field. This would cause the panel to load without the content.
I was able to fix the issue by modifying your leaflet-sidebar.js class. The relevant change was data.pane to data.panel.
// Create pane node
if (data.panel)
{
if (typeof data.panel === 'string')
{
// pane is given as HTML string
pane = L.DomUtil.create('DIV', 'leaflet-sidebar-pane', this._paneContainer);
content = '';
if (data.title)
content += '<h1 class="leaflet-sidebar-header">' + data.title;
if (this.options.closeButton)
content += '<span class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></span>';
if (data.title)
content += '</h1>';
pane.innerHTML = content + data.panel;
} else
{
// pane is given as DOM object
pane = data.panel;
this._paneContainer.appendChild(pane);
}
pane.id = data.id;
Hope this helps!
The text was updated successfully, but these errors were encountered:
Instead of your proposed fix I'd rather fix the typescript definition from panel to pane.
The actual JS implementation is authoritative, as most users are relying on it, including our examples and documentation.
Hello! I have found an issue with Typescript support in the latest version. It boils down to an extra letter (or maybe one less than enough?)
In the vanilla module when you add a panel you set the 'pane' field, yet in the Typescript definition it is the 'panel' field. This would cause the panel to load without the content.
I was able to fix the issue by modifying your leaflet-sidebar.js class. The relevant change was data.pane to data.panel.
Hope this helps!
The text was updated successfully, but these errors were encountered: