Skip to content

onLinkClick in Pivot Not Functioning Correctly When Inside fluentPage #167

Answered by jakubsob
justacec asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @justacec,

this is not a bug. onLinkClick is a prop that should be a function. Please take a look at the docs of this component.

Please take a look at this example:

library(shiny)
library(shiny.fluent)

shinyApp(
  ui = tagList(
    textOutput("text"),
    Pivot(
      onLinkClick = JS('() => alert("Here")'),
      PivotItem(id = "tab1", headerText = "Apples"),
      PivotItem(id = "tab2", headerText = "Bananas")
    )
  ),
  server = function(input, output) {
  }
)

Converting the JS code passed to onLinkClick argument to a function should solve this issue. It works with both fluentPage and tagList.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jakubsob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #164 on March 09, 2023 09:26.