mb21 / JSONedit

User friendly, visual JSON editor built as an Angular 1 directive.
MIT License
566 stars 160 forks source link

long json causes stripes to be out of sync with text #8

Open gonzalobenegas opened 10 years ago

gonzalobenegas commented 10 years ago

Hi, If I use a long json, as in the following example, stripes get out of sync with the text. Is there an easy way to solve it? Thanks { "Name": "Joe", "Last Name": "Miller", "Address": { "Street": "Neverland 42" }, "Hobbies": [ "doing stuff", "dreaming" ], "Name2": "Joe", "Last Name2": "Miller", "Address2": { "Street": "Neverland 42" }, "Hobbies2": [ "doing stuff", "dreaming" ], "Name3": "Joe", "Last Name3": "Miller", "Address3": { "Street": "Neverland 42" }, "Hobbies3": [ "doing stuff", "dreaming" ], "Name4": "Joe", "Last Name4": "Miller", "Address4": { "Street": "Neverland 42" }, "Hobbies4": [ "doing stuff", "dreaming" ] }

mb21 commented 10 years ago

Works fine for me in Chrome. What exactly do you mean with "stripes get out of sync with the text"?

gonzalobenegas commented 10 years ago

screenshot from 2014-05-08 15 39 31

At the bottom, text is no longer centered in the stripe.

mb21 commented 10 years ago

Hm.. it happens only when you zoom in. Will have to look into it..

CaptainYarb commented 10 years ago

This occurs when the line-height of your page conflicts with the default css.

mb21 commented 10 years ago

@blazedd can you send a pull-request with the fixed CSS?

CaptainYarb commented 10 years ago

@mb21 From what I can tell it's highly dependent on the CSS your website uses. I'd need to make a CSS rewrite to make it forcefully overwrite site css

mb21 commented 10 years ago

I'm fairly convinced now that this is due to the calculated height of inline elements. Some of the parent elements get 31px high even when I set the line-height to 30px. I was unable to fix this on all zoom-levels since display: inline-block doesn't seem to change that behaviour in Chrome (haven't tested other browsers).

So the only solution I currently see is rewriting the whole CSS to use block-level elements and have them float to the right place.