infor-design / enterprise

Enterprise-grade component library for the Infor Design System
https://design.infor.com
Apache License 2.0
130 stars 80 forks source link

Datagrid: Lookup cell does not get cell commit before a click handler #8840

Open s-werking opened 1 week ago

s-werking commented 1 week ago

Describe the bug When comparing a text input cell and a lookup cell, the cell commit timing happens differently when a button is clicked while the cell is still in edit mode.

For a text input cell, the cell commit happens and the dataset is updated before the button's click handler runs. For a lookup cell, the button's click handler runs before the cell commit occurs. This causes an issue if the button's handler is relying on the updated data on the lookup cell.

Could the lookup cell timing match what is done for the text input cells? I'm guessing this is also happening for datepicker and timepicker cells.

To Reproduce Steps to reproduce the behavior:

  1. Go to this zipped html page: test-editable-lookup-save-btn.zip
  2. Click on a Price cell and type a new value
  3. Click the Save button
  4. Open the dev console to see that the dataset has been updated with the new cell value.
  5. Click on a Product Id cell and type a new value
  6. Click the Save button
  7. Open the dev console to see that the dataset has NOT been updated with the new cell value.

Expected behavior It is expected that any active changes in the datagrid are considered committed upon clicking a button.

Version

Platform

tmcconechy commented 1 week ago

@s-werking in the past folks have fixed this by calling commitCellEdit() in the button click. Maybe there is something we can do but not sure if its a good plan to put click events on every page button to do it. Maybe can think of some other events like page mouse down?

s-werking commented 1 week ago

Hi @tmcconechy, yes we are handling it on our end for now with the commitCellEdit() call, but a permanent fix for those lookup, datepicker, and timepicker cells to match a regular text input cell would be nice to have. Thanks!