Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userData uploaded file disappears when accordion is closed #1907

Closed
benjaminleonard opened this issue Jan 24, 2024 · 1 comment · Fixed by #1908
Closed

userData uploaded file disappears when accordion is closed #1907

benjaminleonard opened this issue Jan 24, 2024 · 1 comment · Fixed by #1908

Comments

@benjaminleonard
Copy link
Contributor

benjaminleonard commented Jan 24, 2024

Guessing it's still in the form state just not in the FileField.

Wondering if it's a controlled input state thing or we force radix to keep the inputs mounted.

@benjaminleonard benjaminleonard changed the title userData iploaded file disappears when accordion is closed userData uploaded file disappears when accordion is closed Jan 24, 2024
@benjaminleonard
Copy link
Contributor Author

benjaminleonard commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant