primefaces / primefaces/primereact

DataTable: Bad position of match mode filter menu when Portals is deactivated

Open
#5,256 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Resolution: Workaround Type: Bug
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

By deactivating Portals with <PrimeReactProvider value={{ appendTo: "self" }} > surronding datatable, the filter match mode menu of basic filter is positionned on the top-left of the table.

I set the css with .p-column-filter-row { position: relative; }, but there are 2 problems:

  • with few rows in the table, the end of the menu is hidden after the wrapper's bottom border
  • with resizableColumns={true}, after resizing the column, the menu disappears behind tbody

How can I have Portals deactivated and the menu with the same behavior as when Portals is activated?

Reproducer

https://codesandbox.io/s/primereact-demo-forked-w4rswy?file=/src/App.js:6580-6596

PrimeReact version

10.0.9

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome 118

Steps to reproduce the behavior
  1. Go in https://codesandbox.io/s/primereact-demo-forked-w4rswy?file=/src/App.js:6580-6596
  2. Click on the filter button of a column => the menu is on the top-left
  3. Uncomment .p-column-filter-row { position: relative; } l. 22->24 in style.css and click on the filter button of a column => the bottom of the menu is hidden
  4. Uncomment resizableColumns l. 233 in App.js and click on the filter button of a column => the menu is hidden behind tbody
Expected behavior

The filter menu should be correctly displayed when Portals is deactivated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox, especially App.js around the DataTable and style.css around the .p-column-filter-row rule, and reproduce the menu behavior with appendTo set to self. Trace the DataTable filter menu positioning and stacking behavior, including resizableColumns. Done means the menu remains correctly positioned and visible without portals in both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.