brandon-barker / angular-floatThead

A very simple AngularJS wrapper around the awesome floatThead library
https://github.com/mkoryak/floatThead/
MIT License
19 stars 14 forks source link

First row hidden behind float thead when model changes #17

Open blambeau opened 7 years ago

blambeau commented 7 years ago

Hi!

I experience an issue when the table data changes on the ng-model. The first tbody>tr seems to disappear below the floated thead.

See https://jsfiddle.net/t12doyro/1/. When pressing the change-data button, row n°0 disappears.

Trying to debug this by myself, I found that jQuery.floatThead's reflow event looses the real table thead, which makes the table shrink vertically.

I tried to replace the reflow call and use "destroy + reinstall", but the behavior tends to be even worse: in my angular application, it leads to thead being missing on completely unrelated tables with floatThead enabled too...

Any idea?

jmusser73 commented 7 years ago

+1

lreindl commented 7 years ago

It seems that the reflow within the ngModel formatters is not waiting for the table to render. I tested this by adding some delay to the timeout. It worked better at about 300 milliseconds for me. Probably not the perfect solution but I think this is where the issue is.