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

bs_btn with link creates type=button anchor tag #22

Open
fiedl opened this issue Nov 21, 2021 · 1 comment
Open

bs_btn with link creates type=button anchor tag #22

fiedl opened this issue Nov 21, 2021 · 1 comment

Comments

@fiedl
Copy link

fiedl commented Nov 21, 2021

Context

This concerns the button component:
https://github.com/matestack/matestack-ui-bootstrap/blob/main/lib/matestack/ui/bootstrap/components/button.rb

Scenario

Specifying a link for a bs_btn:

bs_btn "wählen", link: { path: dashboard_path }

Observed behaviour

A <a type="button" class="btn btn-primary"> tag is generated, which is not styled as expected by bootstrap.

Bildschirmfoto 2021-11-22 um 00 00 26

Expected behaviour

To be styled correctly by bootstrap, the tag should be:

  • <button type="button" class="btn btn-primary">, or:
  • <a class="btn btn-primary"> (without the type)

Bildschirmfoto 2021-11-22 um 00 03 34

Workaround

Overwrite the type attribute:

bs_btn "wählen", type: "", link: { path: dashboard_path }

Browsers

I have observed this in Safari. It looks correct, however, in Chrome.

@aaron-contreras
Copy link
Member

Hey @fiedl , I see this has been open for a while. I've actually experienced this exact behavior while working on a client project and didn't realize there was an open issue for it here. I'll work on a fix for it. Thanks for documenting the root cause, that helps a lot and makes it quite cookie-cutter for me :)

@aaron-contreras aaron-contreras changed the title bs_btn with link creates bs_btn with link creates type=button anchor tag Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants