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

[menu] Menu is rendered outside viewport #3025

Open
mvorisek opened this issue Mar 26, 2024 · 3 comments
Open

[menu] Menu is rendered outside viewport #3025

mvorisek opened this issue Mar 26, 2024 · 3 comments
Labels
needs-more-info state/awaiting-investigation Anything which needs more investigation type/discussion Anything which is up for discussion type/usage Any support issues asking for help

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Mar 26, 2024

Bug Report

Steps to reproduce

  1. open https://ui.atk4.org/demos/data-action/jsactionsgrid.php
  2. narrow the browser window height (to about half the table height, not critical)
  3. notice, when the menu is opened above, the button are rendered above the current viewport and cannot be clicked

Actual result

image

Expected result

I would expect the menu to be opened above the source button only if it cannot fit below, but also if it cannot fit above.

If if cannot fit below (and not above), the page height should be extended.

Version

2.9.3 / latest

@mvorisek mvorisek added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Mar 26, 2024
@lubber-de
Copy link
Member

Can you provide a jsfiddle, because the atk page throws a 502 bad gateway

image

@lubber-de
Copy link
Member

lubber-de commented Mar 27, 2024

If if cannot fit below (and not above), the page height should be extended.

I don't think FUI should change the page height automatically on its own, because that's out of scopr of the dropdown component and most probably interferes with application logic. And we will not resize the browser window, that's part of the application and it's responsive design.

The logic ever since SUI is here

if (onScreen.below) {
module.verbose('Dropdown can fit in context downward', onScreen);
canOpenDownward = true;
} else if (!onScreen.below && !onScreen.above) {
module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);
canOpenDownward = true;
} else {
module.verbose('Dropdown cannot fit below, opening upward', onScreen);
canOpenDownward = false;
}

In doubt, you can force a direction via the direction-setting
image

@lubber-de lubber-de added type/discussion Anything which is up for discussion type/usage Any support issues asking for help needs-more-info and removed type/bug Any issue which is a bug or PR which fixes a bug state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels Mar 27, 2024
@mvorisek
Copy link
Contributor Author

I have updated the repro link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info state/awaiting-investigation Anything which needs more investigation type/discussion Anything which is up for discussion type/usage Any support issues asking for help
Projects
None yet
Development

No branches or pull requests

2 participants