Repository navigation
core: add TooltipElement and route HasTooltipElement through it (#139) - #180
Merged
Merged
Conversation
Wrap `vaadin-tooltip` as a standalone element: text, opened state, position, and a helper that opens the tooltip by hovering its target. `HasTooltipElement` becomes a facade over the new element rather than a parallel API — `getTooltip()` returns a `TooltipElement`, and the existing `getTooltipLocator()` / `getTooltipText()` / `assertTooltipHasText()` delegate to it, so callers are unaffected. Two behaviours the API had to be shaped around: - The host is `display: contents` and renders through the overlay in its shadow DOM, so open/closed is asserted on the reflected `opened` attribute; `getOverlayLocator()` is there for tests that need the box. - `Tooltip.setPosition(...)` only sets a DOM property on the host — the overlay is what reflects the effective position (default `bottom`), so that is where `getPosition()` reads it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wrap
vaadin-tooltipas a standalone element: text, opened state, position, and a helper that opens the tooltip by hovering its target.HasTooltipElementbecomes a facade over the new element rather than a parallel API —getTooltip()returns aTooltipElement, and the existinggetTooltipLocator()/getTooltipText()/assertTooltipHasText()delegate to it, so callers are unaffected.Two behaviours the API had to be shaped around:
display: contentsand renders through the overlay in its shadow DOM, so open/closed is asserted on the reflectedopenedattribute;getOverlayLocator()is there for tests that need the box.Tooltip.setPosition(...)only sets a DOM property on the host — the overlay is what reflects the effective position (defaultbottom), so that is wheregetPosition()reads it.