fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

ContextMenu doesn't work in popup page from firefox extension

Open yajiex opened this issue 7 years ago • 3 comments

I'm trying to use use ContextMenu in firefox extension popup page, however for following sample code, when I load it in extension popup page, clicking the button, the context menu doesn't show.

import React from 'react';
import ReactDOM from 'react-dom';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { ContextualMenuItemType } from 'office-ui-fabric-react';

ReactDOM.render(<DefaultButton
    text="Click for ContextualMenu"
    menuProps={{
        shouldFocusOnMount: true,
        items: [
            {
                key: 'newItem',
                text: 'New',
            },
            {
                key: 'divider_1',
                itemType: ContextualMenuItemType.Divider
            },
        ],
    }}
/>, document.getElementById('work'));

yajiex avatar Feb 20 '19 11:02 yajiex

Hi @yajiex Can you please provide a Codepen repro? Here's one of ContextualMenu to get you started https://codepen.io/pen/?&editable=true. Also please fill out the Issue template in full, especially the environment information - what are the Fabric package & the browser & OS versions?

aneeshack4 avatar Feb 20 '19 21:02 aneeshack4

Spoke offline with @yajiex - We do support Firefox but not the plugins/extensions so resolving as external.

aneeshack4 avatar Feb 21 '19 00:02 aneeshack4

For those who may be interested, I got the reason. In popup page of Firefox extension, resize event is fired for no reason, which causes dismiss is called for contextMenu. A workaround would be stop the event propagation for resize event, but a more proper way would be to investigate why resize event is fired, I will investigate that later.

yajiex avatar Feb 26 '19 10:02 yajiex