question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[dropdown-item] Render as button if neither HREF or TO provided, or add option to render as button?

See original GitHub issue

BS V4.alpha.6 .dropdown-items support both using links or buttons (although there are slight styling issues between the two font-wise, which will be fixed in beta release https://github.com/twbs/bootstrap/issues/22560). http://v4-alpha.getbootstrap.com/components/dropdowns/#menu-items

Maybe the dropdown-item component should create a <button class="dropdown-item"></button> when both href and to are falsy? rather than using a link tag?.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
mosinvecommented, May 13, 2017
1reaction
MarZabcommented, May 9, 2017

That makes sense since you did ask for a button to begin with.

I would argue we stick with the link as default for the dropdown for the same reason. It would look and behave exactly as the router and link variants.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropdowns | React-Bootstrap
By default the <DropdownToggle> will render a Button component and accepts all the same props ... <Dropdown.Item href="#/action-2">Another action</Dropdown.
Read more >
Bootstrap Dropdown not working in React - Stack Overflow
To make dropdown menu and other js stuff work in 4th Bootstrap you ... to resolve this issue. when you click on dropdown...
Read more >
Dropdown | Components - BootstrapVue
You can customize the text of the dropdown button by using either the text ... <div> <b-dropdown text="Button text via Prop"> <b-dropdown-item href="#">An ......
Read more >
Dropdowns - Bootstrap
For this reason, Bootstrap does not expect (nor automatically add) any of the ... Wrap the dropdown's toggle (your button or link) and...
Read more >
Customize a reusable React dropdown menu component
In that case, a radio button would be a better option. ... Now, take a look at the render() method of our component....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found