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

[DSS-225] Popover - add caret to popover #1637

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

QuintonJason
Copy link
Contributor

@QuintonJason QuintonJason commented Nov 17, 2022

Description

  • add caret to all popover instances
  • update the horizontal position based on presence of tooltip
  • create jira issue for border / rotation pattern DSS-226

Screenshots

Before After
popover-positions popover-caret

Testing in sage-lib

Testing in kajabi-products

  1. (LOW) Add caret to Popover. Minimal visual change

Related

Closes DSS-225

@QuintonJason QuintonJason marked this pull request as ready for review November 21, 2022 21:10
@QuintonJason QuintonJason requested review from a team November 21, 2022 21:10
Comment on lines +70 to +76
&::after {
left: $-popover-tooltip-offset;
top: 100%;
transform: translate3d(-50%, 0, 0);
border-left: $-popover-tooltip-inactive;
border-right: $-popover-tooltip-inactive;
border-top: $-popover-tooltip-active;
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like most of this could move up to line 60 so we don't have to repeat it for each modifier, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much of this code isn't repeating as each modifier has different positional properties and 3 border sides updated. The only common thing I was able to pull out was

through 60. Is that what you're referring to?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, is it possible to make the shape with the same three border declarations and then rotate it correctly or does that get funky with alignment?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, is it possible to make the shape with the same three border declarations and then rotate it correctly or does that get funky with alignment?

Love this (assuming the alignment/position doesn't get all out of whack with the transform).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@goodwinchris I created this task for that work. The tooltip could also benefit from such change as well, so created a ticket for a shared function that both tooltip and popover would consume: https://kajabi.atlassian.net/browse/DSS-226

Copy link
Member

@teenwolfblitzer teenwolfblitzer left a comment

Choose a reason for hiding this comment

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

👍🏼 Looks and works great on larger screens. On mobile there's an existing issue with position that will require further discussion/follow-up.

content: "";
position: absolute;
}

.sage-popover--is-expanded & {
visibility: visible;
}

.sage-popover--top & {
Copy link
Member

@teenwolfblitzer teenwolfblitzer Nov 21, 2022

Choose a reason for hiding this comment

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

I believe this has been brought up before since it's an existing issue, but popovers on mobile have a high potential to break layouts. Though the caret addition helps with orientation, we should also consider standardizing display of all popovers on mobile, regardless of specified position.

Since we're only affecting the visibility on the popover, and its default position is right-aligned to its toggle/trigger, the popover's content tends to overflow the parent container on smaller screens. Even worse, left-positioned popovers can't be viewed/scrolled at all due to the overlay lock.

popover mobile overflow
popover truncated

Design will want to weigh in here, but treating popover content in the same way as a modal (centered on screen, fixed position) might be an option.

Copy link
Contributor Author

@QuintonJason QuintonJason Nov 22, 2022

Choose a reason for hiding this comment

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

@monkeypox8 created DSS-227 for tracking this work

Comment on lines +70 to +76
&::after {
left: $-popover-tooltip-offset;
top: 100%;
transform: translate3d(-50%, 0, 0);
border-left: $-popover-tooltip-inactive;
border-right: $-popover-tooltip-inactive;
border-top: $-popover-tooltip-active;
Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, is it possible to make the shape with the same three border declarations and then rotate it correctly or does that get funky with alignment?

Love this (assuming the alignment/position doesn't get all out of whack with the transform).

- add caret to all popover instances
- update the horizontal position based on presence of tooltip
@QuintonJason QuintonJason force-pushed the DSS-225_qj-add-caret-to-popovers branch from 8e10bac to fef81f3 Compare November 30, 2022 01:06
@QuintonJason QuintonJason mentioned this pull request Nov 30, 2022
@QuintonJason QuintonJason merged commit b92e86c into develop Nov 30, 2022
@QuintonJason QuintonJason deleted the DSS-225_qj-add-caret-to-popovers branch November 30, 2022 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants