Commit fd344d5
fix: invalidate overlay content size cache on positionTarget change
The PositionMixin caches the largest content size ever measured via
`Math.max(__oldContentWidth, offsetWidth)` to keep alignment stable
under window-resize squeeze. The cache was never invalidated when
`positionTarget` changed, so an overlay that switched to a target with
smaller content (e.g. a tooltip moving from a long-text item to a
short-text one) kept calculating fit against the previous larger size
and stayed flipped to the wrong side.
Reset `__oldContentWidth` and `__oldContentHeight` whenever
`positionTarget` changes so the next `_updatePosition` measures the
overlay against its current content.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 81e3599 commit fd344d5
2 files changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
514 | 538 | | |
515 | 539 | | |
516 | 540 | | |
| |||
0 commit comments