I opened this pull request to fix L.Draw.Tooltip wrong position the first time it was shown.
More details in #871.
Basically, we don't have access to the cursor position when the tooltip is initialized, so the trick is to wait after the time the tooltip have access to the cursor position before making it visible ;)
It required to add some states properties this.isTooltipEmpty, this._hasPosition next to this._visible in order to handle all cases.
I can also add some unitary tests on _onFirstMouseMove and the state properties to make the change more time proof.
Hello!
I opened this pull request to fix L.Draw.Tooltip wrong position the first time it was shown. More details in #871.
Basically, we don't have access to the cursor position when the tooltip is initialized, so the trick is to wait after the time the tooltip have access to the cursor position before making it visible ;) It required to add some states properties
this.isTooltipEmpty, this._hasPosition
next tothis._visible
in order to handle all cases.I can also add some unitary tests on
_onFirstMouseMove
and the state properties to make the change more time proof.See ya !