CarlosNZ / json-edit-react

React component for editing/viewing JSON/object data
https://carlosnz.github.io/json-edit-react/
MIT License
183 stars 18 forks source link

Empty string is a valid object key but is not allowed nor parsed correctly as input #66

Closed jeffsenn closed 5 months ago

jeffsenn commented 5 months ago

Describe the bug Empty string is a valid object key but is not allowed nor parsed correctly as input Try to add a key to a object named "" (the empty string) Or provide such an object value as input in code (and then editting that value produces an error)

Expected behavior Empty string should work like every other valid key

Screenshots Not required

Online demo Not required

CarlosNZ commented 5 months ago

Good catch, thanks. Will look into it.

CarlosNZ commented 5 months ago

Hi @jeffsenn, this should be fixed now. Please try v1.11.7.

This is how it appears by default, but you can change the <empty string> display by overriding the jer-empty-string::after CSS pseudo class:

Screenshot 2024-06-10 at 11 49 33 PM