react-contexify icon indicating copy to clipboard operation
react-contexify copied to clipboard

TypeError: event.stopPropagation is not a function in 6.0.0

Open huajingbucengyuankesao opened this issue 2 years ago • 3 comments

TypeError: event.stopPropagation is not a function

When I was integrating the react-contexify plugin and running my project, the error "TypeError: event.stopPropagation is not a function" appeared when I right-click. I am using version 6.0.0

huajingbucengyuankesao avatar Jun 16 '23 09:06 huajingbucengyuankesao

me too

vedant-shah avatar Jul 25 '23 09:07 vedant-shah

Working version:

 const { show } = useContextMenu({
    id: 'card_context_menu'
  })
  
   <Col xl='3' md='4' sm='6'  onClick={show}></Col>
   <Menu id='card_context_menu'>
            <Item onClick={() => handleCopy(request)}>{intl.formatMessage({ id: 'copy' })}</Item>
      </Menu>

TypeError: event.stopPropagation is not a function

  const { show } = useContextMenu({
    id: 'card_context_menu'
  })

  function displayMenu(e) {
    show({
      event: e
    })
  }
  
     <Col xl='3' md='4' sm='6'  onClick={displayMenu}></Col>
   <Menu id='card_context_menu'>
            <Item onClick={() => handleCopy(request)}>{intl.formatMessage({ id: 'copy' })}</Item>
      </Menu>

e Object in displayMenu is a SyntheticBaseEvent 

goktugacik avatar Aug 08 '23 12:08 goktugacik

The parameter event of the show function requires a domevent. The domevent of some events does not exist stopPropagation.

hsbtr avatar Nov 14 '23 07:11 hsbtr