You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
userData uploaded file disappears when accordion is closed #1907
changed the title [-]`userData` iploaded file disappears when accordion is closed[/-][+]`userData` uploaded file disappears when accordion is closed[/+]on Jan 24, 2024
After some initial testing, forceMount does work – but it does trip up the animation and despite my wrangling, I'm not sure we can have the animation work with CSS alone. In summary:
Force mount keeps all Accordion.Content elements in the DOM. We can't use display: none to hide them because that does not work with animation. We can use visibility: hidden but they still take up space. By adding forwards to the css animation they do stay hidden (in combo with height: 0) but the animation hasn't run on load so the space is still taken until the use clicks on them. The closest I've got is getting the close animation to work – with the animation plus a height and visibility transition – but not open.
Using react-spring here might be easiest.
Alternative we use the File from the form state. Because whilst the input is uncontrolled, we have own little wrapper on top. Unsure if we maintain the link to the file even when the file input itself is detached.
Activity
[-]`userData` iploaded file disappears when accordion is closed[/-][+]`userData` uploaded file disappears when accordion is closed[/+]benjaminleonard commentedon Jan 24, 2024
After some initial testing,
forceMountdoes work – but it does trip up the animation and despite my wrangling, I'm not sure we can have the animation work with CSS alone. In summary:Force mount keeps all
Accordion.Contentelements in the DOM. We can't usedisplay: noneto hide them because that does not work with animation. We can usevisibility: hiddenbut they still take up space. By addingforwardsto the css animation they do stay hidden (in combo withheight: 0) but the animation hasn't run on load so the space is still taken until the use clicks on them. The closest I've got is getting the close animation to work – with the animation plus a height and visibility transition – but not open.Using
react-springhere might be easiest.Alternative we use the
Filefrom the form state. Because whilst the input is uncontrolled, we have own little wrapper on top. Unsure if we maintain the link to the file even when the file input itself is detached.