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

Change button checkbox/radios to ignore hidden input fields #27802

Merged
merged 3 commits into from
Dec 10, 2018
Merged

Change button checkbox/radios to ignore hidden input fields #27802

merged 3 commits into from
Dec 10, 2018

Conversation

mvastola
Copy link
Contributor

@mvastola mvastola commented Dec 7, 2018

Allows for HTML like:

<div class="btn-group-toggle" data-toggle="buttons">
  <label class="btn btn-info">
    <input name="checkbox" type="hidden" value="0">
    <input id="cb" name="checkbox" type="checkbox" value="1" autocomplete="off"> Click Me
  </label>
</div>

Fixes #27795

@mvastola mvastola requested a review from a team as a code owner December 7, 2018 22:58
@mvastola
Copy link
Contributor Author

mvastola commented Dec 7, 2018

NB: I wasn't sure if I was supposed to do npm run dist for my PR. I opted not to because, upon running it, I saw changes were being applied that weren't due to this patch. Please let me know if I should have run this.

@XhmikosR
Copy link
Member

XhmikosR commented Dec 8, 2018

Why not just exclude inputs with type=hidden?

@mvastola
Copy link
Contributor Author

mvastola commented Dec 8, 2018

@XhmikosR, we could. It's just a matter of preference. I'm happy to change if desired.

@mvastola
Copy link
Contributor Author

mvastola commented Dec 8, 2018

@XhmikosR, oh. I'm sorry. I was on mobile and for some reason it didn't show the "Member" tag. I'll go and change it.

js/src/button.js Outdated Show resolved Hide resolved
@mvastola
Copy link
Contributor Author

mvastola commented Dec 8, 2018

Oh. I left it because I wasn't sure if it was used elsewhere and forgot to check. I'll remove. Just pushed the change in the attribute selector.

Allows for HTML like:
```html
<div class="btn-group-toggle" data-toggle="buttons">
  <label class="btn btn-info">
    <input name="checkbox" type="hidden" value="0">
    <input id="cb" name="checkbox" type="checkbox" value="1" autocomplete="off"> Click Me
  </label>
</div>
```

Fixes #27795
@mvastola
Copy link
Contributor Author

mvastola commented Dec 8, 2018

Done

@XhmikosR XhmikosR changed the title Updates button checkbox/radios to ignore hidden form fields Change button checkbox/radios to ignore hidden input fields Dec 10, 2018
@mdo mdo mentioned this pull request Dec 10, 2018
@XhmikosR XhmikosR merged commit fc15c4c into twbs:v4-dev Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants