fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

feat: add automatic position adjustment to FluentMenu to prevent opening off-screen.

Open DanielCordell opened this issue 1 year ago • 3 comments

🙋 Feature Request

It would be great if the <FluentMenu> component would adjust the position it was created in if it would be hidden by being partially outside of the window. This would make the menus function similarly to native menus that dynamically adjust to avoid being obscured.

🤔 Expected Behavior

Menus upon opening adjust their position to avoid being partially outside of the window.

(manually adjusted in this screenshot below) image

😯 Current Behavior

The menu appears half "outside" of the window, meaning it cannot be interacted with.

image

This occurs for both anchored and non-anchored menus.

🔦 Context

Menus on the right-hand-side of the window / at the bottom of the window are being cut off by the window itself.

DanielCordell avatar Feb 21 '24 09:02 DanielCordell

This will be fixed the next version (v3) of the underlying web components. We can't change that ourselves.

vnbaaij avatar Feb 21 '24 19:02 vnbaaij

Awesome, thanks for the update! Is there a specific timeline as to when V3 comes out, and in what version of FluentUI Blazor that would apply to? (e.g. 4+) I can't find anything on the FluentUI repo about a V3 release date.

DanielCordell avatar Feb 26 '24 13:02 DanielCordell

It is currently in beta stage. See https://web-components.fluentui.dev/?path=/docs/concepts-introduction--page. The code is in the web-components-v3 branch in the FluentUI repo.

We have only done some initial testing with this and are waiting for the web components to stabalize. As a lot of things (parameters, token, etc) will change, it will be a new major release of the library on our side (so v5 or v6).

vnbaaij avatar Feb 26 '24 14:02 vnbaaij

One thing we are changing is adding VerticalThreshold and HorizontalThreshold parameters which will help in positioning the menu better. See #1640 for more info. I'll close this issue in favor of that one

vnbaaij avatar Mar 06 '24 06:03 vnbaaij