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

Ease usage of buttons with dropdown #1873

Open
jelhan opened this issue Feb 28, 2023 · 0 comments
Open

Ease usage of buttons with dropdown #1873

jelhan opened this issue Feb 28, 2023 · 0 comments

Comments

@jelhan
Copy link
Contributor

jelhan commented Feb 28, 2023

<BsDropdown> component provides an intuitive API for having links in a dropdown:

<BsDropdown as |dd|>
  <dd.toggle>Dropdown <span class="caret"></span></dd.toggle>
  <dd.menu as |ddm|>
    <ddm.item>
      <ddm.linkTo @route="index">Something</ddm.linkTo>
    </ddm.item>
  </dd.menu>
</BsDropdown>

But it does not provide a good API for having buttons in a dropdown. Using a button currently looks like this:

<BsDropdown as |dd|>
  <dd.toggle>Dropdown <span class="caret"></span></dd.toggle>
  <dd.menu as |ddm|>
    <ddm.item>
      <button class="dropdown-item" type="button" {{on "click" this.doSomething}}>Action</button>
    </ddm.item>
  </dd.menu>
</BsDropdown>

Yielding a <ddm.button> similar to the existing <ddm.linkTo> would make the API more ergonomic.

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

1 participant