By default all new zones are created with a name that is an integer instead of a string.
addZone() {
const ids = new Set<number>();
for (const z of this.zones) {
ids.add(z.id);
}
const newid = Math.max(...ids) + 1;
this.zones.push(new WasabeeZone({ id: newid, name: newid }));
...
Type persists across store/rehydration in indexeddb. If zone name is edited, will then correctly be a string.
This results in tooltip not displaying for zones until the name is modified. You get a traceback such as:
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at NewClass._updateContent (<anonymous>:12954:11)
at NewClass.update (<anonymous>:12856:10)
at NewClass._prepareOpen (<anonymous>:12936:11)
at NewClass.openTooltip (<anonymous>:13778:40)
at NewClass._openTooltip (<anonymous>:13829:10)
at NewClass.fire (<anonymous>:3800:13)
at NewClass._fireDOMEvent (<anonymous>:7606:17)
at NewClass._fireEvent (<anonymous>:15791:15)
at NewClass._handleMouseHover (<anonymous>:15777:12)
at NewClass._onMouseMove (<anonymous>:15743:10)
This is due to an explicit branch on type in L.DivOverlay:
_updateContent: function () {
if (!this._content) { return; }
var node = this._contentNode;
var content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;
if (typeof content === 'string') {
node.innerHTML = content;
} else {
while (node.hasChildNodes()) {
node.removeChild(node.firstChild);
}
node.appendChild(content);
}
...
There may be other consequences / bugs as well. Filing this issue to track and to raise awareness.
By default all new zones are created with a name that is an integer instead of a string.
Type persists across store/rehydration in indexeddb. If zone name is edited, will then correctly be a string.
This results in tooltip not displaying for zones until the name is modified. You get a traceback such as:
This is due to an explicit branch on type in
L.DivOverlay
:There may be other consequences / bugs as well. Filing this issue to track and to raise awareness.