You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 returnstrue, triggering theswitchCellToViewMode()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
isOutsideClicked()function is executed before the down arrow SVG is replaced, the Dropdown opens and behaves correctly.Reproducer
https://stackblitz.com/edit/8apgvuc5-zrqniw2f?file=src%2FApp.jsx
System Information
primereact: 10.8.5 => 10.9.6DEMO
recordPrimeReactDropdownBug.mov
Expected behavior
When using the Dropdown as a cell editor in the DataTable:
Quick fix
I do not think it is the right approach but the quick fix is to apply the following style: