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

Compatibility for columns with no row parent container #37

Open
wants to merge 1 commit into
base: main
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/layers.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bs3compat_layer <- function() {
"bs3compat", packageVersion("bootstraplib"),
package = "bootstraplib",
src = "bs3compat/js",
script = c("tabs.js", "bs3compat.js")
script = c("tabs.js", "bs3compat.js", "no_row_container.js")
)
)
}
Expand Down
7 changes: 7 additions & 0 deletions inst/bs3compat/_no_row_container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.no-row-container-bs3compat {
display: flex;
}

.tab-content > .active.no-row-container-bs3compat {
display: flex;
}
2 changes: 2 additions & 0 deletions inst/bs3compat/_rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

@import "glyphicons";

@import "no_row_container";

@import "shiny_input";
@import "shiny_misc";
9 changes: 9 additions & 0 deletions inst/bs3compat/js/no_row_container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// BS4 cols need their parent container to be a flex container
// in order to render properly
$(function() {
let el = $("[class*='col-sm-']").parent();
if (el.length === 0) return;
if (!el.hasClass("row")) {
el.addClass("row").addClass("no-row-container-bs3compat");
}
});