Skip to content

Conditional rendering is not working for accordion tabs #1458

Closed

Description

@adityapatil9191

Scope: <DESCRIBE SCOPE OF THIS ISSUE, i.e.: PF4 mapper, Form renderer>
https://codesandbox.io/p/sandbox/react-data-driven-autocomplete-3yy7r6?file=%2Fsrc%2Findex.js
Description

In the above code sandbox if we add condition to accordion tabs, for example if a form accordion tab should be visible only if form value present in another Accordion tab is true or has some value, then the conditions don't work and the accordion tab is always visible.

Schema

<If it's possible, please provide a schema which reproduces the issue>

Activity

  1. adityapatil9191 commented on May 10, 2024

    @adityapatil9191
    Author

    Please help / respond

  2. rvsia commented on May 10, 2024

    @rvsia
    Contributor

    Hey, if I understand your issue correctly, then I think the issue is here:

    Snímek obrazovky 2024-05-10 v 7 29 11

    When you render tab components, there is actually no data driven from component (so no condition is calculated), but you render directly children of the component. You can wrap this section to a new component in the mapper and then just do formOptions.renderForm(fields)

  3. locked and limited conversation to collaborators on May 10, 2024
  4. converted this issue into a discussion #1459 on May 10, 2024
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