Skip to content

nav_panel_hidden() visible and keyboard navigable to in navset_pill_list() #1264

@jack-davison

Description

@jack-davison

Describe the problem

Create a nav_panel_hidden() within a navset_pill_list() and navigate to it.

  1. There is padding in the list that makes it visible.

  2. If you keyboard navigate to the pill list by tabbing and press up/down you can navigate to it. You don't actually need to "activate"/select the hidden tab for this to happen - you can do it from the off.

I imagine (1) is unintentional, not sure about (2) - in some ways its more accessible, but also a keyboard user could happen upon a page that they're not meant to by using tabs/arrows.

Image
library(bslib)
library(shiny)

ui <- page_fixed(
  navset_pill_list(
    id = "root",
    nav_panel(
      title = "visible",
      input_task_button(
        id = "button",
        label = "Find hidden"
      )
    ),
    nav_panel_hidden(
      value = "hidden",
      "content"
    )
  )
)

server <- function(input, output, session) {
  observe({
    nav_select("root", "hidden")
  }) |>
    bindEvent(input$button)
}

shinyApp(ui, server)

Session Info

Details

─ Session info ──────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.5.1 (2025-06-13 ucrt)
 os       Windows 11 x64 (build 26100)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United Kingdom.utf8
 ctype    English_United Kingdom.utf8
 tz       Europe/London
 date     2025-12-08
 rstudio  2025.09.1+401 Cucumberleaf Sunflower (desktop)
 pandoc   NA
 quarto   ERROR: Unknown command "TMPDIR=C:/Users/JD38/AppData/Local/Temp/Rtmp2n0gc0/filefdc449440a5". Did you mean command "install"? @ C:\\Users\\JD38\\AppData\\Local\\Programs\\Quarto\\bin\\quarto.exe

─ Packages ──────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
bslib * 0.9.0.9002 2025-12-08 [1] Github (rstudio/bslib@0757592)
cachem 1.1.0 2024-05-16 [1] CRAN (R 4.5.1)
callr 3.7.6 2024-03-25 [1] CRAN (R 4.5.1)
cli 3.6.5 2025-04-23 [1] CRAN (R 4.5.1)
curl 7.0.0 2025-08-19 [1] CRAN (R 4.5.1)
desc 1.4.3 2023-12-10 [1] CRAN (R 4.5.1)
devtools 2.4.6 2025-10-03 [1] CRAN (R 4.5.1)
digest 0.6.39 2025-11-19 [1] CRAN (R 4.5.1)
ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.5.1)
fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.5.1)
fontawesome 0.5.3 2024-11-16 [1] CRAN (R 4.5.1)
fs 1.6.6 2025-04-12 [1] CRAN (R 4.5.1)
glue 1.8.0 2024-09-30 [1] CRAN (R 4.5.1)
htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.5.1)
httpuv 1.6.16 2025-04-16 [1] CRAN (R 4.5.1)
jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.5.1)
jsonlite 2.0.0 2025-03-27 [1] CRAN (R 4.5.1)
later 1.4.4 2025-08-27 [1] CRAN (R 4.5.1)
lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.5.1)
magrittr 2.0.4 2025-09-12 [1] CRAN (R 4.5.1)
memoise 2.0.1 2021-11-26 [1] CRAN (R 4.5.1)
mime 0.13 2025-03-17 [1] CRAN (R 4.5.0)
otel 0.2.0 2025-08-29 [1] CRAN (R 4.5.1)
pillar 1.11.1 2025-09-17 [1] CRAN (R 4.5.1)
pkgbuild 1.4.8 2025-05-26 [1] CRAN (R 4.5.1)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.5.1)
pkgload 1.4.1 2025-09-23 [1] CRAN (R 4.5.1)
processx 3.8.6 2025-02-21 [1] CRAN (R 4.5.1)
promises 1.5.0 2025-11-01 [1] CRAN (R 4.5.2)
ps 1.9.1 2025-04-12 [1] CRAN (R 4.5.1)
purrr 1.2.0 2025-11-04 [1] CRAN (R 4.5.2)
R6 2.6.1 2025-02-15 [1] CRAN (R 4.5.1)
Rcpp 1.1.0 2025-07-02 [1] CRAN (R 4.5.1)
remotes 2.5.0 2024-03-17 [1] CRAN (R 4.5.1)
rlang 1.1.6.9000 2025-10-10 [1] Github (r-lib/rlang@b351966)
rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.5.1)
sass 0.4.10 2025-04-11 [1] CRAN (R 4.5.1)
sessioninfo 1.2.3 2025-02-05 [1] CRAN (R 4.5.1)
shiny * 1.11.1 2025-07-03 [1] CRAN (R 4.5.1)
tibble 3.3.0 2025-06-08 [1] CRAN (R 4.5.1)
usethis 3.2.1 2025-09-06 [1] CRAN (R 4.5.1)
vctrs 0.6.5.9000 2025-10-10 [1] Github (r-lib/vctrs@5b539da)
xtable 1.8-4 2019-04-21 [1] CRAN (R 4.5.1)

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