diff --git a/README.md b/README.md index c2684c2e..f1ff180d 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,12 @@ npm start Let popup div stretch with trigger element. enums of 'width', 'minWidth', 'height', 'minHeight'. (You can also mixed with 'height minWidth') + + hideContextMenuOnScroll + boolean + true + close popup when trigger type contains 'onContextMenu' and document is scrolling + diff --git a/docs/examples/case.tsx b/docs/examples/case.tsx index 2d24a8e4..168e375a 100644 --- a/docs/examples/case.tsx +++ b/docs/examples/case.tsx @@ -217,6 +217,7 @@ const Demo = () => { onPopupAlign={() => { console.warn('Aligned!'); }} + hideContextMenuOnScroll={false} >
(); @@ -240,7 +242,7 @@ export function generateTrigger( ); } // close popup when trigger type contains 'onContextMenu' and document is scrolling. - if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { + if (props.hideContextMenuOnScroll && !this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { currentDocument = currentDocument || props.getDocument(this.getRootDomNode()); this.contextMenuOutsideHandler1 = addEventListener(