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

[Bug]: Combobox options list overflows the screen top under small viewports #27565

Closed
2 tasks done
RamyRafik opened this issue Apr 13, 2023 · 3 comments
Closed
2 tasks done
Labels
Component: Combobox Fluent UI react-components (v9) Needs: Investigation The Shield Dev should investigate this issue and propose a fix Resolution: Soft Close Soft closing inactive issues over a certain period

Comments

@RamyRafik
Copy link
Contributor

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 Intel(R) Xeon(R) W-2255 CPU @ 3.70GHz
    Memory: 37.63 GB / 63.69 GB
  Browsers:
    Edge: Spartan (44.22621.1555.0), Chromium (111.0.1661.62)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

https://codesandbox.io/s/runtime-river-pg2kgy?file=/example.tsx

Bug Description

Actual Behavior

Currently, the listbox (Options list) has a max-height of 80vh. This would work if the Combobox is at the top or bottom of the page, but doesn't work if it's in the middle.
Under small viewports (where the listbox can't open to the bottom or right), the listbox would overflow the screen top edge.
image

Expected Behavior

The listbox should be always clamped by the screen edges.

Logs

No response

Requested priority

High

Products/sites affected

PowerApps

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@smhigley
Copy link
Contributor

This was just fixed in #27521, and should be available now :)

@smhigley
Copy link
Contributor

Ah sorry, I misread the issue -- for comboboxes at screens small enough that they can't fit to the side, above, or below, you're right that they will be clipped.

I think there are two possible approaches:

  1. We let the popup overlap the target when it can't fit on any side
  2. We query the relative position of the trigger element in the document, and set max-height based on that.

This might also apply to Menu and Popover, since I don't believe we do any height-limiting based on available space in v9 yet.

@smhigley smhigley reopened this Apr 14, 2023
@smhigley smhigley added Needs: Investigation The Shield Dev should investigate this issue and propose a fix Component: Combobox and removed Needs: Triage 🔍 labels Apr 14, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Oct 11, 2023
@microsoft-github-policy-service

Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Combobox Fluent UI react-components (v9) Needs: Investigation The Shield Dev should investigate this issue and propose a fix Resolution: Soft Close Soft closing inactive issues over a certain period
Projects
None yet
Development

No branches or pull requests

3 participants