primefaces / primefaces/primereact

DataTable filterDisplay lose focus: DataTable filterDisplay="menu" modal lose onFocus status as soon as you type something

Open
#6,695 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

https://codesandbox.io/p/sandbox/primereact-demo-reproduce-problem-forked-xdl56w?file=%2Fsrc%2FApp.tsx

DataTable filterDisplay loses focus: DataTable filterDisplay="menu" modal looses onFocus status as soon as you type something.

This happen specifically when a Table starts after some content on top as per my example. I tried scrolling into top view when we click the input element but it keep losing focus.

Go to codesandbox link example from your mobile device
https://xdl56w.csb.app/

(Not the chrome inspector) because the error happens when we have any sort of keyboard.
Press any menu that has text input.

https://github.com/primefaces/primereact/assets/151073541/1d764cee-0e0e-4aa3-8035-eb760bef1587

Reproducer

https://codesandbox.io/p/sandbox/primereact-demo-reproduce-problem-forked-xdl56w?file=%2Fsrc%2FApp.tsx

PrimeReact version

10.2.1

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Non specific (Happens in all browsers)

Steps to reproduce the behavior

Go to codesandbox link from your mobile device
https://xdl56w.csb.app/
(Not the chrome inspector) because the error happens when we have any sort of keyboard.
Press any menu that has text input.

Expected behavior

The modal shouldn't close on text input change

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 reproduction and its /src/App.tsx on a mobile device, then open a DataTable filter menu containing a text input. Confirm the focus loss while typing and use the expected behavior as the completion check: the modal remains open and the input retains focus when its text changes.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.