Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add arrow overlay part and theme variant to vaadin-popover #7550

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

web-padawan
Copy link
Member

Description

Added theme="pointer-arrow" to Lumo and Material which allows to show an arrow.
The arrow placement is adjusted accordingly to the overlay position change.

For example, when using top position, the overlay can be re-positioned like this:

popover-arrow.mp4

This includes adding the following styling API on the vaadin-popover-overlay:

  • arrow stylable shadow part (could also be a pseudo-element on overlay part)
  • --vaadin-popover-arrow-size custom CSS property (defaults to 0.5rem)
  • arrow-centered attribute set when we need to center the arrow horizontally

Type of change

  • Feature

@web-padawan web-padawan force-pushed the feat/popover-pointer-arrow branch 2 times, most recently from 6c1453a to f5dea82 Compare July 15, 2024 10:33
@@ -59,6 +59,8 @@ export const PopoverOverlayMixin = (superClass) =>
return;
}

this.removeAttribute('arrow-centered');
Copy link
Contributor

@vursen vursen Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I'm not sure why it's only needed for horizontal positions. I tested vertical positions and they magically work without this attribute. I would appreciate a brief explanation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a result of different logic for start and end vertical positions where we always center the overlay. This aligns with how vaadin-tooltip positions work, although I don't remember why it was done this way.

@web-padawan web-padawan changed the title feat: add pointer-arrow theme variant to vaadin-popover feat: add arrow overlay part and theme variant to vaadin-popover Jul 25, 2024
@web-padawan
Copy link
Member Author

Updated to rename from pointer-arrow to arrow as discussed internally (other popovers just call it arrow).

Copy link

sonarcloud bot commented Jul 25, 2024

@web-padawan web-padawan removed the request for review from sissbruecker July 25, 2024 09:12
@web-padawan web-padawan merged commit 39f03b7 into main Jul 25, 2024
9 checks passed
@web-padawan web-padawan deleted the feat/popover-pointer-arrow branch July 25, 2024 09:13
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha6 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants