Skip to content

Commit 33897b5

Browse files
committed
The parent of grid column(s) needs display:flex to be displayed properly in BS4
1 parent 39ff000 commit 33897b5

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

R/layers.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ bs3compat_layer <- function() {
8080
"bs3compat", packageVersion("bootstraplib"),
8181
package = "bootstraplib",
8282
src = "bs3compat/js",
83-
script = c("tabs.js", "bs3compat.js")
83+
script = c("tabs.js", "bs3compat.js", "no_row_container.js")
8484
)
8585
)
8686
}

inst/bs3compat/_no_row_container.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.no-row-container-bs3compat {
2+
display: flex;
3+
}
4+
5+
.tab-content > .active.no-row-container-bs3compat {
6+
display: flex;
7+
}

inst/bs3compat/_rules.scss

+2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66

77
@import "glyphicons";
88

9+
@import "no_row_container";
10+
911
@import "shiny_input";
1012
@import "shiny_misc";

inst/bs3compat/js/no_row_container.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// BS4 cols need their parent container to be a flex container
2+
// in order to render properly
3+
$(function() {
4+
let el = $("[class*='col-sm-']").parent();
5+
if (el.length === 0) return;
6+
if (!el.hasClass("row")) {
7+
el.addClass("row").addClass("no-row-container-bs3compat");
8+
}
9+
});

0 commit comments

Comments
 (0)