2.0.0-RC1 Datatable - onEditComplete events firing only after ENTER
I'm submitting a ... (check one with "x") [ x] bug report => Search github for a similar issue or PR before submitting
Plunkr Case (Bug Reports) Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
Current behavior In recent 2.0.0-RC1, rate of onEditComplete events for Datatable is noticable lower that in 1.1.4. In 1.1.4 onEditComplete was fired for each loose of focus for edited field. Now, by design (accroding to sources), the event is fired only after user edited the value and confirmed in with ENTER stroke. This creates confusion, as ngModel is updated regardless of ENTER.
Expected behavior Expected to work as in 1.1.4 - onEditComplete should be fired after each exit from edited field (as in javascript onBlur event).
Minimal reproduction of the problem with instructions Plain Datatable with editable=true.
What is the motivation / use case for changing the behavior? onEditComplete is beneficial when tracking changes in field, especially when used together with onEditInit. Now onEditComplete is useless for this. onEdit gives way too much calls, when the only thing that matters is difference betweed the start and end of edit.
- Angular version: 2.3.1
- PrimeNG version: 2.0.0-RC1
- Browser: all
- Language: TypeScript 2.0
- Node (for AoT issues): v6.8.0
This is also some functionality I'm in need of on my current project.
Thanks!
Yeah OnEditComplete is only invoked when ENTER key is pressed, and not when changing the focus :( Any workarounds?
Need this fixed for our project as well.
You may use onEdit to get notified while cell is being edited and onEditComplete when editing is completed with enter key.
@cagataycivici and what about when editing is completed by any other means? Clicking outside the field also concludes editing but does not trigger onEditComplete. Think of the touchscreen users.
Yes, think of the touchscreen users! @StevenLiekens
https://github.com/primefaces/primeng/issues/2967