Skip to content

Fix clash with parmesan caused in langSelector #31

@lenafm

Description

@lenafm

In langSelector the updateSelectLangInput inside the initLocale reactive was causing a clash with the parmesan package and therefore blocking modals from opening. In particular, modals from shinypanels::showModalMultipleId (example to reproduce this problem can be found in inst/examples/ex07-translate_with_parmesan) were not opening. The temporary fix was to remove this updateSelectLangInput which means that shi18ny only works with language parameters from the URL, but not with the language dropdown.

The following code snippet shows the reactives initLocale and currentLocale how they are working right now, with the old code commented out. Uncomment the commented sections to reproduce issue.

initLocale <- reactive({
    selected <- queryLang() %||% config$defaultLang

    message("selected2 ", selected," config ", config$defaultLang)
    message(showSelector)

    if(showSelector){
      shinyjs::show("langContainer")
    }
    message("config_av_langs",config$availableLangs)

    # uncomment the following to reproduce problem
    # updateSelectLangInput(session, 'langInner', 
    #                       langs = config$availableLangs,
    #                       selected = selected)

    message("selected3", selected, " config ", config$defaultLang)
    selected
  })

  currentLocale <- reactive({
    initLocale()
    newLocale <- queryLang() # comment out this to reproduce problem
    # newLocale <- input$langInner # uncomment this to reproduce problem
    message("initLocale: ", initLocale())
    message("input3 ", newLocale, " is null ",is.null(newLocale))

    newLocale
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions