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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated checkboxes and radios to match bootstrap 5 #6633

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/bootstrap-table.js
Expand Up @@ -379,7 +379,7 @@ class BootstrapTable {
if (column.checkbox) {
text = ''
if (!this.options.singleSelect && this.options.checkboxHeader) {
text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>'
text = '<label><input name="btSelectAll" type="checkbox" class="form-check-input" /><span></span></label>'
}
this.header.stateField = column.field
}
Expand Down Expand Up @@ -682,7 +682,7 @@ class BootstrapTable {

html.push(
Utils.sprintf(this.constants.html.toolbarDropdownItem,
Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>',
Utils.sprintf('<div class="form-check"><input type="checkbox" class="toggle-all form-check-input" %s> <span>%s</span></div>',
allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())
)
)
Expand Down Expand Up @@ -712,7 +712,7 @@ class BootstrapTable {

if (column.switchable) {
html.push(Utils.sprintf(this.constants.html.toolbarDropdownItem,
Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>',
Utils.sprintf('<div class="form-check"><input type="checkbox" class="form-check-input" data-field="%s" value="%s"%s%s> <span>%s</span></div>',
column.field, i, checked, disabled, column.title)))
switchableCount++
}
Expand Down Expand Up @@ -1678,6 +1678,7 @@ class BootstrapTable {
`<td class="bs-checkbox ${c}"${class_}${style_}>`,
`<label>
<input
class="form-check-input"
data-index="${i}"
name="${this.options.selectItemName}"
type="${type}"
Expand Down
5 changes: 0 additions & 5 deletions src/themes/_theme.scss
Expand Up @@ -159,11 +159,6 @@

label {
margin-bottom: 0;

input[type="radio"],
input[type="checkbox"] {
margin: 0 auto !important;
}
}
}

Expand Down