Subject of the issue
When a Hot Graphic item's _tooltip._position is an empty string (""), the tooltip renders correctly on first display but shifts position after the item is visited. The tooltip changes from is-bottom is-middle to is-bottom is-right. A related issue also affects _classes - runtime classes like is-active (added on hover) can be stripped by the same change handler.
Your environment
- Framework: 5.55.2
- Browser and version: All browsers
- Device(s) and OS: All
Steps to reproduce
- Add a Hot Graphic component with tooltips enabled
- Set
_tooltip._position to "" (empty string) on an item - or leave it present but empty via the authoring tool
- Observe the tooltip renders at bottom center (
is-bottom is-middle)
- Click the pin to visit the item
- Observe the tooltip has shifted to bottom right (
is-bottom is-right)
Expected behaviour
The tooltip should remain at bottom center after the item is visited, and runtime classes should not be stripped.
Actual behaviour
The tooltip shifts from bottom center to bottom right after the item is visited.
Root cause
In hotgraphicModel.js, the setUpItems() method resolves an empty _position to 'outside bottom middle middle' during initial tooltip registration. However, the child.on('change') listener spreads ...tooltip back into the tooltip model on every child attribute change (including _isVisited). When _position is "", this overwrites the resolved value with the empty string. The tooltip then falls back to TooltipItemView.js's default of 'outside bottom middle right' - a different default - causing the visible shift.
The bug only triggers when _position is present as an empty string. When the key is absent entirely (undefined), the spread produces no _position key and the resolved value is preserved.
Posted via collaboration with Claude Code
Subject of the issue
When a Hot Graphic item's
_tooltip._positionis an empty string (""), the tooltip renders correctly on first display but shifts position after the item is visited. The tooltip changes fromis-bottom is-middletois-bottom is-right. A related issue also affects_classes- runtime classes likeis-active(added on hover) can be stripped by the same change handler.Your environment
Steps to reproduce
_tooltip._positionto""(empty string) on an item - or leave it present but empty via the authoring toolis-bottom is-middle)is-bottom is-right)Expected behaviour
The tooltip should remain at bottom center after the item is visited, and runtime classes should not be stripped.
Actual behaviour
The tooltip shifts from bottom center to bottom right after the item is visited.
Root cause
In
hotgraphicModel.js, thesetUpItems()method resolves an empty_positionto'outside bottom middle middle'during initial tooltip registration. However, thechild.on('change')listener spreads...tooltipback into the tooltip model on every child attribute change (including_isVisited). When_positionis"", this overwrites the resolved value with the empty string. The tooltip then falls back toTooltipItemView.js's default of'outside bottom middle right'- a different default - causing the visible shift.The bug only triggers when
_positionis present as an empty string. When the key is absent entirely (undefined), the spread produces no_positionkey and the resolved value is preserved.Posted via collaboration with Claude Code