Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Removing value in numeric cell results in empty string #10738

Open
Dissident26 opened this issue Jan 18, 2024 · 3 comments
Open

[Bug]: Removing value in numeric cell results in empty string #10738

Dissident26 opened this issue Jan 18, 2024 · 3 comments

Comments

@Dissident26
Copy link

Describe the bug

Removing value from cell with editor opened results in empty string is set to the cell value.

Repro steps: double click on a cell with type "numeric" and see console.log, value should not be a string in "numeric" type cell.

Video/Screenshots

image

Provide a link to the demo with the bug reproduction

https://jsfiddle.net/r8n3q205/8/

Handsontable version

"^13.1.0"

Framework version

No response

Your environment

chrome, windows

@adrianszymanski89
Copy link
Contributor

Hi @Dissident26

I wouldn't consider it as a bug. All our built-in validators treat null or empty strings as valid. Only the values not in the correct format for the defined type are treated as invalid.

@Dissident26
Copy link
Author

Hi @Dissident26

I wouldn't consider it as a bug. All our built-in validators treat null or empty strings as valid. Only the values not in the correct format for the defined type are treated as invalid.

Hi @adrianszymanski89, thanks for answering.

Yes, I do understand that, and it's fine to check on falsy values. But in my opinion it's the matter of type, not the falsy values.
When you have a type validation on number | null it's not obvious that you would get a value of type string eventually.

@AMBudnik
Copy link
Contributor

You are right, @Dissident26. While checking the docs I did not find clear information on what we get.

We say at http://localhost:8080/docs/javascript-data-grid/keyboard-shortcuts/#selection-keyboard-shortcuts that

Zrzut ekranu 2024-01-19 o 13 49 43

and in general, cleaning is rather setting up null, as in clear() method that we can test here https://jsfiddle.net/3r9sa28L/.

But then when you select a cell it is treated more like an action of a cell editor and there we put an empty string.

So maybe we could add an option to allow developers setting up what the clear should mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants