Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Support virtualization for Menu #2155

Open
elgasano opened this issue Dec 6, 2019 · 1 comment
Open

Support virtualization for Menu #2155

elgasano opened this issue Dec 6, 2019 · 1 comment
Labels
vsts Paired with ticket in vsts

Comments

@elgasano
Copy link

elgasano commented Dec 6, 2019

Feature Request

For menu with large number of items, there will be good to support virtualization similar to that react list virtualizied provided

Problem description

Large menu collection will bring a considerable latency, therefore support for virtualization is essential

Proposed solution

Potentially react virtualized list can be used beneath menu list

MVP

@pkumarie2011 pkumarie2011 added the vsts Paired with ticket in vsts label Dec 6, 2019
@jurokapsiar
Copy link
Contributor

Virtualization is possible with react-virtualized even now, see https://codesandbox.io/s/fluent-ui-example-bx012

Even though this has some accessibility limitations, I think you can follow the codesandbox for now.
Couple of points to be careful about:

  • make sure to use aria-posinset and aria-setsize
  • shorthand API in menu passes some of the props and variables down to its items, this is not available when you use the children API (Menu.Item component), so props like 'vertical' need to be passed to the items as well. Also, if you have some theme overrides in the menu, double check if they are correctly applied - you might need to pass variables to the items as well
  • react-virtualized wraps items in a grid container which breaks the semantic structure. react-window would be preferred

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
vsts Paired with ticket in vsts
Projects
None yet
Development

No branches or pull requests

3 participants