primeng icon indicating copy to clipboard operation
primeng copied to clipboard

2.0.0-RC1 Datatable - onEditComplete events firing only after ENTER

Open Miosss opened this issue 9 years ago • 7 comments

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

Miosss avatar Jan 26 '17 14:01 Miosss

This is also some functionality I'm in need of on my current project.

Thanks!

derricksimpson avatar Feb 13 '17 13:02 derricksimpson

Yeah OnEditComplete is only invoked when ENTER key is pressed, and not when changing the focus :( Any workarounds?

ezzkht avatar Feb 19 '17 08:02 ezzkht

Need this fixed for our project as well.

hiteshanchan avatar Mar 10 '17 15:03 hiteshanchan

You may use onEdit to get notified while cell is being edited and onEditComplete when editing is completed with enter key.

cagataycivici avatar Mar 27 '17 14:03 cagataycivici

@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.

sliekens avatar Jun 14 '17 12:06 sliekens

Yes, think of the touchscreen users! @StevenLiekens

bickycheese avatar Jun 15 '17 11:06 bickycheese

https://github.com/primefaces/primeng/issues/2967

mattqs avatar Jul 02 '17 03:07 mattqs