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 hitting "Enter" to complete a cell's edition, if the table is inside a form, the form is submitted before onCellEditComplete() is called, leaving no opportunity to prevent form submission through event.stopPropagation(). This is likely due to onCellEditComplete() being wrapped with setTimeout(), I wonder why:
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Feb 20, 2024
During my tests, I found a second problem: the enter key of the numeric keypad is not taken into account. This is because its "code" is "NumpadEnter", not "Enter". The "key" field should probably be used instead, as its value is "Enter" both for the regular and the numpad enter keys. There might be more places in the codebase with this issue.
As for my main problem, I still don't know how to circumvent the fact that my table is inside a form and cell editing needs to be independent from form submission, particularly given the setTimeout() that is in place. Any suggestions?
This might be seen as related to #3977. I believe it could be regarded as the same underlying problem: events at one layer trickle down to other layers that should not be affected.
Its not related to #3977 the idea is the same but the implementation and fix is totally different. Can you open a new ticket for NumpadEnter as that is also a different issue than this original issue of the setTimeout.
Describe the bug
When hitting "Enter" to complete a cell's edition, if the table is inside a form, the form is submitted before
onCellEditComplete()
is called, leaving no opportunity to prevent form submission throughevent.stopPropagation()
. This is likely due toonCellEditComplete()
being wrapped withsetTimeout()
, I wonder why:primereact/components/lib/datatable/BodyCell.js
Line 182 in 6cd5730
Reproducer
No response
PrimeReact version
10.5.1
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: