Skip to content

f7InsertTab: Reactive elements created inside are losing reactiviy #134

@ppagnone

Description

@ppagnone

Hi, thanks for your great job with this package!

In the example below, I am creating a reactive input inside of a tab created with f7InsertTab and this is losing the reactivity.
Also I saw that icon of f7tab is not rendering when is created with f7InsertTab (in all browsers).

Thanks in advance

library(shinyMobile)
ui = function(){
    f7Page(
    title = "Test", 
    manifest = "manifest.json",
    init = f7Init(
      skin = "aurora",
      theme = "light",
      filled = FALSE,
      color = "red",
      hideTabsOnPageScroll = FALSE,
      serviceWorker = "service-worker.js",
      iosTranslucentBars = FALSE,
      pullToRefresh = FALSE
    ),
    f7TabLayout(
      navbar = f7Navbar(
        title = "Test",
        hairline = FALSE,
        shadow = TRUE,
        left_panel = TRUE,
        right_panel = FALSE
      ),
      f7Tabs(
        animated = FALSE,
        swipeable = TRUE,
        id="tabs",
        f7Tab(
          tabName = "Home",
          icon = f7Icon("house"),
          active = TRUE
        )
      )
    )
  ) 
}

server = function(input, output, session) {
  
  observe({
  
    f7InsertTab(
      inputId = "tabs",
      position = "after",
      target = "Home",
      tab =       f7Tab(
        tabName = "Settings",
        icon = f7Icon("gear"),
        active = FALSE,
        f7Card(title = "Language",
               f7Select(
                 inputId = session$ns("language"),
                 label = "Language",
                 choices = c("en_us","es_ar"),
                 selected = "es_ar")
        )
      ),
      select = FALSE
      
    )
  })
  
  observeEvent(input$language,{
    print("on select language")
    browser()
  })
  
}

shiny::shinyApp(ui = ui, server = server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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