Skip to content

userData uploaded file disappears when accordion is closed #1907

Closed

Description

@benjaminleonard

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.

Activity

  1. changed the title [-]`userData` iploaded file disappears when accordion is closed[/-] [+]`userData` uploaded file disappears when accordion is closed[/+] on Jan 24, 2024
  2. benjaminleonard commented on Jan 24, 2024

    @benjaminleonard
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions