Animation on row contraction
See original GitHub issueI really love the new expandable-row feature, however I got an issue with it : I can’t manage to animate the contraction of a row.
I succeeded to animate the expansion using the following code :
@keyframes EXPAND {
0% { height: 0; }
100% { height: 300px; }
}
.react-bs-container-body tr:nth-child(2n+2):not([hidden]) td div {
animation: EXPAND 1s;
height: 300px;
}
This code isn’t great but does the job, however I haven’t been able to animate contraction using the same method.
I think it’s because the hidden
attribute is added instantly to the tr
element before any animation can be performed.
Any idea ?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
I want to animate individual cells, rows, or columns in my table
in the drop-down list. On the Animations tab, in the Animations group, click Custom Animation. In the Custom Animation task pane, click Add...
Read more >ASPxGridView - How to animate group expansion/contraction
Hello,. ASPxGridView loads rows on a callback, so in fact, the group row does not get expanded but the whole grid page gets...
Read more >Animating CSS Grid Rows and Columns | by Chen Hui Jing
Animate with transitions Using transitions is one way to animate your grid rows and columns. If your design adjusts the grid structure to...
Read more >Physically Based Forehead Modelling and Animation ...
9.6 Animation of the flat forehead block model under contraction of the frontalis. ... the voxelisation process is performed on each row of...
Read more >Skin deformation simulation with muscle co-contraction. Top
This deformation is difficult to animate in a realistic fashion using traditional ... The top row represents the simulated skin deformation, the middle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ptitFicus, thanks your investigation, it’s awesome. As your mentioned, it’s really hard to tune the structure by
div
currently.Anyway, I thought it’s better to solve this issue by pure css instead of a hacky javascript so I’ll try to find some solution, but this issue will be a lower priority to process.
Thanks, let me know if you still have any question.
Ok, I spent some time on this, and here is what I think.
I don’t think that there is any way of animating row contraction with the current table structure. As mentioned before, this is due to the use of the
hidden
attribute, that instantly hide the table row, making it impossible to animate.However the hidden tag is not the only issue here. Let’s pretend we move down the hidden attribute on the
td
element instead of thetr
. Line animation would still be impossible since an htmltr
element cannot be animated directly : the only way to animate it is by animating its content, however the content would instantly disappear due to the use of thehidden
attribute on thetd
element.Note that the problem would be the same if using
display: none
instead of thehidden
attribute, since it has the same instantaneous effect.I ended up using a super dirty solution : I delay the click event on row to let some time to the component to animate, and when it’s done I rethrow the another click event to trigger line contraction. Here is what I get, the ugly part is in
handleCellClick
method.To conclude I think that animating contracting row is very complicated right now, but I don’t see any light modification of the codebase to make it easier. It would probably be simpler if using div instead of html table as suggested by #907, however it would be a huge modification of the codebase for such a limited need.