Make dropdown menus actually dropdown #5381

Merged
DispatchCommit merged 3 commits from ui/animation-tweaks into master 2021-01-27 16:05:03 +01:00
DispatchCommit commented 2021-01-26 02:14:27 +01:00 (Migrated from github.com)

I was annoyed that our dropdown menus didn't actually... dropdown.

odysee-dropdown-animation

So I fixed them:

lbry-dropdown-animation

The CSS change uses a translation instead of a scalar operation to translate the popover menu down 80px rather than expanding by scaling about the center of Y.

Translated 80px because that is the height of the top bar, and for some reason the popover component will affect the scroll position if it renders offscreen. That is, if we were to translate by 100px, it being partially offpage when it is first created will cause the page scroll up by 20px.

I looked into why it is that way, and it's because the popover menu is rendered as position:absolute and the position depends on the scroll location. Seems like this really should just be a position:fixed, but I don't want to open that Pandora's box potentially.

tldr: better dropdown animation.

I was annoyed that our dropdown menus didn't actually... dropdown. ![odysee-dropdown-animation](https://user-images.githubusercontent.com/45262335/105785412-aae26f00-5f2f-11eb-87bf-903366274eaf.gif) So I fixed them: ![lbry-dropdown-animation](https://user-images.githubusercontent.com/45262335/105785437-b766c780-5f2f-11eb-80e0-64a0b34c3765.gif) The CSS change uses a translation instead of a scalar operation to translate the popover menu down 80px rather than expanding by scaling about the center of Y. Translated 80px because that is the height of the top bar, and for some reason the popover component will affect the scroll position if it renders offscreen. That is, if we were to translate by 100px, it being partially offpage when it is first created will cause the page scroll up by 20px. I looked into why it is that way, and it's because the popover menu is rendered as `position:absolute` and the position depends on the scroll location. Seems like this really should just be a `position:fixed`, but I don't want to open that Pandora's box potentially. tldr: better dropdown animation.
neb-b (Migrated from github.com) reviewed 2021-01-26 02:14:27 +01:00
neb-b (Migrated from github.com) requested changes 2021-01-26 16:13:03 +01:00
neb-b (Migrated from github.com) commented 2021-01-26 16:12:57 +01:00

This should use var(--header-height) (which is 80px)

This should use `var(--header-height)` (which is 80px)
DispatchCommit (Migrated from github.com) reviewed 2021-01-27 12:34:08 +01:00
DispatchCommit (Migrated from github.com) commented 2021-01-27 12:34:08 +01:00

changed, thanks.

changed, thanks.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#5381
No description provided.