Skip to content

Commit

Permalink
conditional ensures created.onAdd preserved in edge cases, no longe…
Browse files Browse the repository at this point in the history
…r assigns `undefined`
  • Loading branch information
Stassi committed Nov 17, 2024
1 parent 8617c2c commit 19388cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/leaf/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function control({
...props,
})

created.onAdd = onAdd ? onAdd : undefined
if (onAdd) created.onAdd = onAdd

return map ? created.addTo(map) : created
}

0 comments on commit 19388cb

Please sign in to comment.