Skip to content

Commit

Permalink
The parent of grid column(s) needs display:flex to be displayed prope…
Browse files Browse the repository at this point in the history
…rly in BS4
  • Loading branch information
cpsievert committed Jan 21, 2020
1 parent 39ff000 commit 8f0bbe6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
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("no-row-container-bs3compat");
}
});

0 comments on commit 8f0bbe6

Please sign in to comment.