Below, the inserted tab should not be highlighted and the width is wrong (should be 33% instead of 50%):
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Insert a tab Before the target",
f7TabLayout(
panels = tagList(
f7Panel(title = "Left Panel", side = "left", theme = "light", "Blabla", effect = "cover"),
f7Panel(title = "Right Panel", side = "right", theme = "dark", "Blabla", effect = "cover")
),
navbar = f7Navbar(
title = "Tabs",
hairline = FALSE,
shadow = TRUE,
leftPanel = TRUE,
rightPanel = TRUE
),
f7Tabs(
animated = FALSE,
id = "tabs",
f7Tab(
tabName = "Tab 1",
icon = f7Icon("airplane"),
active = TRUE,
"Tab 1",
f7Button(inputId = "go", label = "Go")
),
f7Tab(
tabName = "Tab 2",
icon = f7Icon("today"),
active = FALSE,
"Tab 2"
)
)
)
),
server = function(input, output, session) {
observeEvent(input$go, {
insertF7Tab(
id = "tabs",
position = "before",
target = "Tab 1",
tab = f7Tab(
tabName = paste0("Tab ", input$go + 2),
f7Slider("obs", "Number of observations:",
min = 0, max = 1000, value = 500
),
plotOutput("distPlot"),
icon = f7Icon("app_badge_fill")
),
select = FALSE
)
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
})
}
)
Below, the inserted tab should not be highlighted and the width is wrong (should be 33% instead of 50%):