nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 394 forks source link

The validation timing is delayed depending on the action of modifying the cell. #1861

Open sakang07 opened 1 year ago

sakang07 commented 1 year ago

Describe the bug

Hello. Thank you for your hard work on the development.

I created a code that validates the data entered in the grid using onEditingFinish event. When the user enters the string data in the columns specified by the number type, and finishes the modification, this code notifies the user by displaying an alert.

But I found that the validate method works differently depending on the modification action. It works correctly when the user exits the modification using Enter, but validate does not detect an error when the user clicks on another cell or ends the modification with Tab. The same applies to modifications such as Delete keys. Then, the error is detected only when the next cell is modified.

In addition, the same is true when correcting errors. If you modify the cell that is string to number and end the modification with the action of not pressing Enter, validate does not detect that the error is gone and still displays an error alert.

To resolve this issue, I looked up the event list and found the beforeChange event, but this event was not available as onBeforeChange event. I couldn't solve the type error.

Is this a bug? How do I solve it? I am attaching a code sandbox that can reproduce the bug.

Thank you for reading it. I look forward to hearing from you.


To Reproduce

Steps to reproduce the behavior:

  1. Go to number column
  2. Double click on the cell
  3. Type a string word
  4. Click other cell
  5. See error(The alert doesn't open)

Expected behavior

The alert open.

Desktop (please complete the following information):