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

dashboardPage shouldn't create <title> HTML tags if title = NULL #393

Open
Mkranj opened this issue Mar 2, 2023 · 1 comment
Open

dashboardPage shouldn't create <title> HTML tags if title = NULL #393

Mkranj opened this issue Mar 2, 2023 · 1 comment

Comments

@Mkranj
Copy link

Mkranj commented Mar 2, 2023

Description

I'm using several dashboardPages inside of a navbarPage tabset for a project. Each call to dashboardPage automatically creates a new <title> tag in the finished app's HTML, even though title is set to NULL in dashboardPage, as well as in dashboardHeader. This creates problems, e.g., for screen readers.

Proposed outcome

If title = NULL in both dashboardPage and dashboardHeader, no additional <title> tags should be generated.

Example of issue

Run the following code snippet, and check the resulting page's source HTML:

ui <- navbarPage(
  title = "Actual title",
      dashboardPage(
        title = NULL,
        dashboardHeader(title = NULL),
        dashboardSidebar(),
        dashboardBody()
      )
    )

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

Only <title>Actual title</title> is supposed to be present, but there's also an additional <title></title>
For precedents, consider what happens when setting title = NULL in the navbarPage. This generates no empty <title></title>, leaving only the one generated by dashboardPage!

@Mkranj
Copy link
Author

Mkranj commented Mar 3, 2023

If the snippet throws an error, I've wrapped the dashboardPage in a tabPanel:

ui <- navbarPage(
  title = "Actual title",
  tabPanel(
  dashboardPage(
    title = NULL,
    dashboardHeader(title = NULL),
    dashboardSidebar(),
    dashboardBody()
  )
  )
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant