Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Dropdown: Item list immediately closes after opening #8080

Description

@howkymike

Issue Description

When using the Dropdown as a cell editor in the DataTable, the options list closes immediately after being opened.

Root Cause

This issue occurs because the isOutsideClicked() method incorrectly returns true, triggering the switchCellToViewMode() function which closes the editor and the dropdown list. This happens because the down arrow SVG icon inside the Dropdown is replaced by the up arrow SVG (to indicate the list is expanded), causing the down arrow SVG to be detached from the DOM, making it appear as though a click occurred outside the DataTable.

Additional Notes

  • This behavior is also inconsistent due to a race condition - if the isOutsideClicked() function is executed before the down arrow SVG is replaced, the Dropdown opens and behaves correctly.
  • When you click on the arrow's container instead of clicking directly on the arrow image (i.e. you click on the surrounding margin), it works correctly.

Reproducer

https://stackblitz.com/edit/8apgvuc5-zrqniw2f?file=src%2FApp.jsx

System Information

primereact: 10.8.5 => 10.9.6

DEMO

recordPrimeReactDropdownBug.mov

Expected behavior

When using the Dropdown as a cell editor in the DataTable:

  • The options list should remain open when clicked and allow the user to interact with the options, without closing prematurely.
  • The Dropdown interaction should work consistently and not be impacted by DOM changes to the arrow SVG.

Quick fix

I do not think it is the right approach but the quick fix is to apply the following style:

.pp-dropdown-trigger-icon {
  pointer-events: none;
}

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a defect related to a specific component.

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions