microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.51k stars 2.73k forks source link

Panel blocks 3rd party component dropdown function. #20339

Closed iamchangming closed 2 years ago

iamchangming commented 3 years ago

Environment Information

Please provide a reproduction of the bug in a codepen:

I met issue to add the ckeditor4-react package to codepen, but I have setup a very simple one with codesandbox.

https://codesandbox.io/s/ckeditor4-0dojn?file=/src/App.js

Actual behavior:

The dropdowns, "Styles", "Normal", does not work if shown in the Panel. But works without the Panel.

Expected behavior:

Should work with AND without the panel.

Priorities and help requested:

Are you willing to submit a PR to fix? (No)

Requested priority: (Blocking)

Products/sites affected: (if applicable) Microsoft internal UCM site. https://ucm.ads.microsoft.com/ We are building a Panel with CKEditor to edit notes.

gouttierre commented 2 years ago

@iamchangming -Thanks for filing this issue with us. To set expectations, the developers will review this issue once capacity allows.

@layershifter - Would you be able to confirm if this is a regression, or if this behavior is an issue when using 3rd party component? Note, the issue was reported by a partner in v7, I will add it to the LP Shield board.

layershifter commented 2 years ago

Clearly, it's not a regression. TL;DR use baseFloatZIndex higher than in Fabric:

image

<CKEditor config={{ baseFloatZIndex: 1000000000 }} />

https://codesandbox.io/s/ckeditor4-forked-cx6ld?file=/src/App.js


Layer in Fabric has really high zIndex value:

https://github.com/microsoft/fluentui/blob/a00fc291f6ffac69ad73907e886ef2d14c48a110/packages/style-utilities/src/styles/zIndexes.ts#L9

As it's higher than value in CKEditor 4 (cfg#baseFloatZIndex) all menus will be rendered under the panel. Set higher value for baseFloatZIndex than in Panel and it will work ✅