react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Dropdown menu showing inside cell

Open luisleong opened this issue 2 years ago • 4 comments

Dropdown menu is showing inside cell, not even with css position fixed or absolute it will be shown above the cell and grid.

To Reproduce

  1. install any dropdown menu (tested with '@szhsin/react-menu' and coreui components)
  2. open dropdown items list (it won't be shown)

Link to code example: { key: "options", name: "Options", formatter(props) { const { row } = props; return (<Menu menuButton={<MenuButton>Overflow</MenuButton>} overflow={'visible'} position={'auto'}> {new Array(50).fill(0).map( (_, i) => <MenuItem key={i}>Item {i + 1}</MenuItem>)} </Menu>) } }

Expected behavior: For the dropdown menu to be shown over the cell and grid.

Environment

  • react-data-grid version: "react-data-grid": "^7.0.0-beta.11",
  • react/react-dom version: "^17.0.1",

Additional context

image

luisleong avatar Apr 08 '22 00:04 luisleong

Please check https://github.com/adazzle/react-data-grid/issues/2709#issuecomment-1010239549.

amanmahajan7 avatar Apr 21 '22 16:04 amanmahajan7

Please check #2709 (comment).

The way I solved, was really ugly, but still did solve it. With css, remove the contain and overflow of the entire cell.

div[role="gridcell"][aria-colindex="1"] {
  contain: none !important;
  overflow: visible !important;
}

luisleong avatar Apr 21 '22 18:04 luisleong

I did resolve with css as well. .rdg .rdg-row .rdg-cell.rdg-editor-container { padding:0; overflow: visible; contain: size style; }

vine1993 avatar May 31 '22 23:05 vine1993

For those attempting to have a dropdown for the column header, changing the rdg-header-row class does the fix (kudos to @vine1993 for the css! 🎉 )

.rdg .rdg-header-row .rdg-cell { padding:0; overflow: visible; contain: size style; }

ding-si-han avatar Aug 02 '22 08:08 ding-si-han