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

Action button as accordion panel icon ruins accordion #952

Open
janion opened this issue Dec 31, 2023 · 2 comments
Open

Action button as accordion panel icon ruins accordion #952

janion opened this issue Dec 31, 2023 · 2 comments

Comments

@janion
Copy link

janion commented Dec 31, 2023

When adding an action button as the icon for an accordion panel, the accordion fails to render correctly. The first title is shown below the panel, and the rest of the panel do not appear at all.

image

Example app:

from shiny import App, Inputs, Outputs, Session, reactive, render, ui


def make_items():
    return [
        ui.accordion_panel(
            f'Section {letter}',
            f"Some narrative for section {letter}",
            icon=ui.input_action_button(id=letter, label='#'))
        for letter in "ABCDE"
    ]


app_ui = ui.page_fluid(
    ui.accordion(*make_items(), id="acc")
)


app = App(app_ui, None)

Thanks for producing this package, I'm really enjoying using it.

@gadenbuie
Copy link
Collaborator

@janion Thanks for opening the issue! In an accordion panel, the entire title area serves as a button that can be clicked to open or close the panel in the accordion. Can you explain a little more about your use case and why you're wanting to use a button as the accordion panel icon?

@janion
Copy link
Author

janion commented Jan 3, 2024

I am using accordion panels to represent a sequence of items which can be individually configured. The button was going to be used as a delete button for each item.

I have found that an action link does work for my purpose, but I thought that this is still worth raising.

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

No branches or pull requests

2 participants