Closed BPernes closed 8 months ago
Can you give a codesandbox with the issue you are having? Since the hover effect is working, I'd assume that e.stopPropagation() on click event would resolve the issue. Try creating a component like this
interface IProps
extends React.DetailedHTMLProps<
React.HTMLAttributes<HTMLDivElement>,
HTMLDivElement
> {}
const stopPropagation = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) =>
e.stopPropagation();
const StopPropagation = observer<IProps>(({ children, ...props }) => {
return (
<div {...props} onClick={stopPropagation}>
{children}
</div>
);
});
And wrapping it around your menu/menu items.
I have noticed the same problem. Below is the link to code sandbox.
https://codesandbox.io/embed/material-demo-forked-9yu2en?fontsize=14&hidenavigation=1&theme=dark @ivan-palatov tried your suggestion but it does not work. I think it is something to do with portal. Please note that grid is in Dialog.
Well, I resolved this problem by condition in file ResizableHeaderCell:
if (event.target.className !== "rdg-header-cell-resizer") return;
I'm also seeing this issue with @szhsin/react-menu
. I was able to work around this by adding onPointerDown={e => e.stopPropagation()}
in my column header's menu component
Describe the bug
To Reproduce
Expected behavior
Environment
react-data-grid
version: 7.0.0-canary.46react
/react-dom
version: 16.8.6material-ui
/core
version: 4.9.5material-ui
/icons
version: 4.4.1