microsoft / microsoft/fluentui

[Feature]: priority-overflow - Weaken assumption that menu is only visible w/ 1+ overflow items

Open
#30,208 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Fluent UI react-components (v9) Package: priority-overflow 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 Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

I've been working the overflow components today, and for our particular use case, we have a desire to have the overflow menu also be visible when there aren't only overflown elements.

The current logic in OverflowManager explicitly checks whether there are any overflown items in order to decide whether to consider the size of the menu: https://github.com/microsoft/fluentui/blob/master/packages/react-components/priority-overflow/src/overflowManager.ts#L87-L103 This means that if we don't have the equivalent of return null (see the example OverflowMenu components in the docs, the sizing logic is incorrect).

From my own quick experiment, changing this line:

const overflowMenuSize = invisibleItemQueue.size() > 0 && overflowMenu ? getOffsetSize(overflowMenu) : 0;

to:

const overflowMenuSize = overflowMenu ? getOffsetSize(overflowMenu) : 0;

My first instinct was to try and find a way to override this default behaviour, but it seems non-trivial. So now I'm wondering whether it'd be better as a configurable option of the overflow itself.

Have you discussed this feature with our team

No response

Additional context

No response

Validations
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Priority

None

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 in packages/react-components/priority-overflow/src/overflowManager.ts at the overflow menu sizing logic described in the issue. Verify the behavior when an overflow menu exists with no overflown items, then determine whether the requested behavior should be the default or a configurable option; done means the menu is sized correctly in that case and the relevant priority-overflow behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.