@@ -255,7 +255,21 @@ export const ParticipantsButton = (props: ParticipantsButtonProps): JSX.Element
255255 const menuProps : IContextualMenuProps = {
256256 title : strings . menuHeader ,
257257 styles : merge ( participantsButtonMenuPropsStyle , styles ?. menuStyles ) ,
258- items : [ ]
258+ items : [ ] ,
259+ calloutProps : {
260+ // Disable dismiss on resize to work around a couple Fluent UI bugs
261+ // - The Callout is dismissed whenever *any child of window (inclusive)* is resized. In practice, this
262+ // happens when we change the VideoGallery layout, or even when the video stream element is internally resized
263+ // by the headless SDK.
264+ // - There is a `preventDismissOnEvent` prop that we could theoretically use to only dismiss when the target of
265+ // of the 'resize' event is the window itself. But experimentation shows that setting that prop doesn't
266+ // deterministically avoid dismissal.
267+ //
268+ // A side effect of this workaround is that the context menu stays open when window is resized, and may
269+ // get detached from original target visually. That bug is preferable to the bug when this value is not set -
270+ // The Callout (frequently) gets dismissed automatically.
271+ preventDismissOnResize : true
272+ }
259273 } ;
260274
261275 if ( participantCount > 0 ) {
@@ -273,10 +287,18 @@ export const ParticipantsButton = (props: ParticipantsButtonProps): JSX.Element
273287 iconProps : { iconName : 'People' } ,
274288 subMenuProps : {
275289 items : generateDefaultParticipantsSubMenuProps ( ) ,
276-
277- // Confine the menu to the parents bounds.
278- // More info: https://github.com/microsoft/fluentui/issues/18835
279- calloutProps : { styles : { root : { maxWidth : '100%' } } }
290+ calloutProps : {
291+ styles : {
292+ root : {
293+ // Confine the menu to the parents bounds.
294+ // More info: https://github.com/microsoft/fluentui/issues/18835
295+ maxWidth : '100%'
296+ }
297+ } ,
298+ // Disable dismiss on resize to work around a couple Fluent UI bugs
299+ // See reasoning in the props for the parent menu.
300+ preventDismissOnResize : true
301+ }
280302 } ,
281303 'data-ui-id' : ids . participantButtonPeopleMenuItem
282304 } ) ;
0 commit comments