microsoft / microsoft/fluentui

[Feature]: For Mac, allow apps that use BaseButton's menus, to configure a property that makes the context menu modal

Open
#29,875 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Fluent UI react (v8) Resolution: Soft Close Type: Feature
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

Library

React / v8 (@fluentui/react)

Describe the feature that you would like added

When the context menu is up is should behave as a modal div for Mac apps:
(1) Hovering on the app surface outside the context menu should not interact with the app surface.
(2) Clicking in the app surface should only dismiss the context menu and not perform any action like selecting an object on the app surface.

Have you discussed this feature with our team

No.

Additional context

Here's my current implementation at my app:

      const menuWrapperElement: HTMLElement | null = document.querySelector(
        ".ms-Callout-container"

      );
      if (!!menuWrapperElement) {
        menuWrapperElement.style.width = "100vw";
        menuWrapperElement.style.height = "100vh";
        menuWrapperElement.addEventListener("click", (e) => {
          if (e?.target === menuWrapperElement) {
            this.onDismiss();
          }
        });
      }
    }
Validations
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Priority

Normal

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how BaseButton creates and dismisses its context menu, then review the surrounding menu and callout behavior for Mac apps. Define where a configurable modal property would be exposed and add coverage for hover and click interactions outside the menu. Done means the option prevents outside interaction while allowing an outside click to dismiss the menu.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.