Skip to content

Allow multiple triggers to modify a single toggle-able node #105

Open
@aaronstezycki

Description

@aaronstezycki

Is your feature request related to a problem? Please describe.
Allowing multiple triggers to interact with the same toggle-able element would be very welcome. For example, a main navigation trigger/button might toggle a modal or 'sidebar' into view. Being able to click on a body link/button trigger to open the same 'sidebar' would allow users the flexibility of which trigger to use to access the modal.

Describe the solution you'd like
Something like ...

<header>
    <button data-toggle-class data-toggle-target=".modal">Open Modal</button>
</header>

<main>
<p><button data-toggle-class data-toggle-target=".modal">This also triggers</button> the modal, but if the modal is already active, it would close the modal instead.</p>
</main>

<!-- is-active from any trigger that targets it -->
<nav class="modal"></nav>

Note: This would also need to work with radio group based triggers. (This is the specific use case I need)

I don't have the time to put together a reduced test case at the minute, but would like to when I have time. This is a great library, and I'd love to see it improve further to solve more edge cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions