Skip to content

insertTab does not properly render the tab link highlight on android #180

@DivadNojnarg

Description

@DivadNojnarg

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))
            })
        })
    }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions