[BUG] adjustRowHeight() works in a hacky way

edited May 2017 in Technical questions

https://webix.com/snippet/44c66a27

For my project I have to put custom markup inside cells of DataTable. Markup in the snippet is very simplified but still able to illustrate the problems.

As you can see, texts inside rows 1, 1.1, and 1.2 (those with <br>) are correctly displayed as two lines.

But text inside row 2 is displayed as ONE line. After a lot (really) of debugging I found that this happens because webix uses hidden div to measure sizes of a cell's content. And this div has following CSS:

.webix_measure_size a,.webix_measure_size div{display:inline-block!important}

Wow, it silently converts all blocks into inline-blocks! Giving a developer unexpected results (and headache).

A was able to "fix" this hack by a counterhack by writing CSS like:

.webix_measure_size .path-item {display:block !important;}

As you can see in the snippet, row 4 has correct height.

I consider this a bug because putting something more complex than a simple text inside a table doesn't seem very extraordinary. I assume that many devs during development of their projects will come to need to put some complex markup in tables. And BOOM! - height adjusting doesn't work. And it is not clear why it doesn't work without thorough digging and debugging.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!