json-edit-react icon indicating copy to clipboard operation
json-edit-react copied to clipboard

Ending bracket horizontally aligned with the key name

Open zowebs opened this issue 5 months ago • 3 comments

Suggestion It would be great if the ending bracket of array/object would be horizontally on the same indent as the key. Right now, it is aligned with the chevron in front of the key

Use case I tried to depict where I would expect the ending bracket to be. There will definitely be more opinions about this, so maybe make it optional prop?

Image

zowebs avatar Aug 05 '25 09:08 zowebs

Hi @zowebs, you should be able to override the CSS to do this as you please. The class you want to target is jer-bracket-outside.

Here's what it looks like after I apply:

.jer-bracket-outside {
  padding-left: 1em;
}
Image

Does that work for you?

As for the suggestion in general, I'll have a look at other similar UI and see if or what the convention is. Thanks for bringing it up :)

CarlosNZ avatar Aug 05 '25 21:08 CarlosNZ

Thank you for provided solution

zowebs avatar Aug 06 '25 07:08 zowebs

All good. But I think you're right though -- now that I look at it, it probably should be aligned with the key. I think I'll probably tweak this in the next update (which means you'll have to undo your CSS fix 😆)

Thanks for bringing it to my attention :)

CarlosNZ avatar Aug 06 '25 08:08 CarlosNZ