fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

onClick event handler for IconButton not working

Open bharath3719 opened this issue 5 years ago • 1 comments

i have the following code. Unable to attach onClick event . How do i attach handler to item click ?

<IconButton menuProps={menuProps} iconProps={menuIcon} title="menu" ariaLabel="menu" onClick={openPopup()} -- Doesnt work onMenuClick= {openPopup()} -- Fires when the menu is clicked , not the item />

const menuProps: IContextualMenuProps = {
    items: [
        {
            key: 'link',
            text: 'Link',
            iconProps: { iconName: 'Link' },
        },
        {
            key: 'deLink',
            text: 'De-link',
            iconProps: { iconName: 'RemoveLink' },
        },
    ],
    onItemClick: { ()=> openPopup() }, -- this also doesnt work
    onItemClick: {  openPopup() }, -- this also doesnt work
    directionalHintFixed: false,
}

bharath3719 avatar Feb 23 '21 06:02 bharath3719

const menuProps: IContextualMenuProps = { items: [ { key: 'link', text: 'Link', iconProps: { iconName: 'Link' }, }, { key: 'deLink', text: 'De-link', iconProps: { iconName: 'RemoveLink' }, }, ], onItemClick: props => { openPopup() }, -- this is the syntax.. directionalHintFixed: false, };

bharath3719 avatar Feb 24 '21 10:02 bharath3719