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

Add AccordionPanel.setClosable(boolean) #8452

Open
sveinnetnordic opened this issue Jan 7, 2025 · 0 comments
Open

Add AccordionPanel.setClosable(boolean) #8452

sveinnetnordic opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement New feature or request vaadin-accordion

Comments

@sveinnetnordic
Copy link

sveinnetnordic commented Jan 7, 2025

Describe your motivation

Having a message thread where one message always should be open.

AccordionPanel of Accordion should not close on click or enter. The panel should only close when an other panel is opened.

Describe the solution you'd like

Add AccordionPanel.setClosable(boolean)

Describe alternatives you've considered

Expert chat and me came up with this solution:
snippets:

vaadin-accordion-panel[opened] {
      pointer-events: none;
    }
.style("pointer-events: auto") //Re-enable pointer events disabled on AccordionPanel
c.element.executeJs("this.onclick = (ev)=>{ev.preventDefault(); ev.stopPropagation(); return false}")

From expert chat to close on keyboard Enter. Will flicker, but keyboard usage is less used

messageThreadAccordion.addOpenedChangeListener { 
            if (messageThreadAccordion.openedIndex.isEmpty) {
                messageThreadAccordion.open(openedIndex)
            }
            openedIndex = messageThreadAccordion.openedIndex.asInt
        }

Additional context

No response

@sveinnetnordic sveinnetnordic changed the title Add AccordionPanel.setOpenedChangeListenerEnabled(boolean) Add AccordionPanel.setClosable(boolean) Jan 8, 2025
@TatuLund TatuLund added the enhancement New feature or request label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-accordion
Projects
None yet
Development

No branches or pull requests

3 participants