Skip to content

fix: Clear-button JS returns one extra value for outputs list - #69

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/app-9ece6282
Open

fix: Clear-button JS returns one extra value for outputs list#69
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/app-9ece6282

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

Problem

fix: Clear-button JS returns one extra value for outputs list

Fix

Replace:

    clear_btn.click(
        None,
        [],
        (input_components + output_components + [input_component_column]),
        _js=f"""() => {json.dumps(
                    [component.cleared_value if hasattr(component, "cleared_value") else None
                     for component in input_components + output_components] + (
                        [gr.Column.update(visible=True)]
                    )
                    + ([gr.Column.update(visible=False)])
                )}
                """,
    )

with:

    clear_btn.click(
        None,
        [],
        (input_components + output_components + [input_component_column]),
        _js=f"""() => {json.dumps(
                    [component.cleared_value if hasattr(component, "cleared_value") else None
                     for component in input_components + output_components]
                    + [gr.Column.update(visible=True)]
                )}
                """,
    )

Files changed

  • demo/app.py

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 this pull request may close these issues.

1 participant