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

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

Closed
DivadNojnarg opened this issue Mar 24, 2021 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@DivadNojnarg
Copy link
Member

DivadNojnarg commented Mar 24, 2021

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))
            })
        })
    }
)
@DivadNojnarg DivadNojnarg added the bug Something isn't working label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant