Closed AdamWard1995 closed 7 years ago
The
didRender
hook is called during both render and re-render after the template has rendered and the DOM updated.
whereas the didInsertElement
hook is called only during initial render. I notice in this PR a lot of refactoring from using didInsertElement
to using didRender
but a lot of the code involves the settings of minimum widths, etc. Do these values need to be recalculated on rerender or should they be left to be set in didInsertElement
?
@notmessenger I had originally wrote it as using didInsertElement so that the cells would only be aligned once. As I tried to integrate this in mcp-ui I noticed that as rows are added and removed through filtering for example, the new rows didn't get aligned
@AdamWard1995 are all (re)calculations needed or just some of them? If all that's fine, just seems while glancing at it (only) that minimum widths would not need to be, for example.
So in the case that a new row is added, a cell may be wider than the current minimum width in which case the whole column needs to be realigned. I can play for a bit and see if it is possible to only do the alignment when this situation occurs
@notmessenger did a best effort to minimize the number of DOM accesses. It should only realign the entire table when the number of rows changes
This project uses semver, please check the scope of this pr:
CHANGELOG