getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

[3.6.0] Dropup falsely triggered, menu hidden #3491

Closed distantnative closed 3 years ago

distantnative commented 3 years ago

When the browser window is very narrow (e.g. developer tools are open), drop gets triggered - which makes it worse than normal dropdown partially hidden.

Screen Shot 2021-07-05 at 16 25 02
afbora commented 3 years ago

As a solution; Then if the dropdown content is greater than the height of the window or so close, the dropup will not enabled.

distantnative commented 3 years ago

Probably rather: (dropdown content height + offset top of dropdown) > window height

afbora commented 3 years ago

Probably rather: (dropdown content height + offset top of dropdown) > window height

Actually we are using already this calculation to show correctly wherever the dropdown is on the page. https://github.com/getkirby/kirby/blob/master/panel/src/components/Navigation/DropdownContent.vue#L147-L148

I have a solution for this issue. I'll create a PR.

distantnative commented 3 years ago

Ah true. We would need: "AND dropdown height < scroll top"

afbora commented 3 years ago

@distantnative Currently dropup feature broken with .k-panel-view changed to static position from absolute in #3492 🙂

distantnative commented 3 years ago

Oh sorry that I broke it. Why doesn't it work with a static positioned view?

afbora commented 3 years ago

.k-panel-view was working on getting visible window height. Currently returns whole page height not visible. Maybe this could be my mistake in implementation. I've changed the dropup implementation on getting visible window height.

bastianallgeier commented 3 years ago

✅