Example application or steps to reproduce the problem
```R
# let's make a wide table
nrow <- 2
ncol <- length(LETTERS)
wide_table <- as.data.frame(matrix(
data = rbinom(2*length(LETTERS), 10, 0.2),
nrow = nrow,
dimnames = list(seq_len(nrow), LETTERS)))
```
```R
# dashboardPage is buggy
if (interactive()) {
library(shinydashboard)
library(shiny)
library(DT)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(
fluidRow(column(12, dataTableOutput('tbl')))
)
),
server = function(input, output) {
output$tbl = renderDataTable(
wide_table, filter="top", rownames=TRUE,
options=list(scrollX=TRUE))
}
)
}
```
```R
# regular fluidPage works well
if (interactive()) {
library(shinydashboard)
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(fluidRow(column(12, dataTableOutput('tbl')))),
server = function(input, output) {
output$tbl = renderDataTable(
wide_table, filter="top", rownames=TRUE,
options=list(scrollX=TRUE))
}
)
}
```
### Describe the problem in detail
Considering:
- using a `dashboardPage` (as demonstrated above, this issue does not affect `fluidPage`)
- a datable with `options=list(scrollX=TRUE)` and `filter="top"`
- scroll to the right, to a column initially out of screen
- click on the filter input for the column
The issue is that upon the last action above, the view of the table header (i.e, column names and top filter inputs) jumps back to the first columns, making it essentially impossible to use the filter input for that column (or any other of those "out of screen" columns).
Note that at that moment, the table body (i.e. the cells) stays in the "scrolled right" view, as they were when the filter input was clicked.
During that time, the view of the table header is basically desynchronised from the table body.
Clicking again on a top filter input makes the table header jump back to the "scrolled right" position, resynchronising them with the table body.
Any feedback or bugfix is welcome!
Thanks!
System details
Browser Version: Safari Version 12.1.1 (14607.2.6.1.1)
Output of
sessionInfo()
:Example application or steps to reproduce the problem
```R # let's make a wide table nrow <- 2 ncol <- length(LETTERS) wide_table <- as.data.frame(matrix( data = rbinom(2*length(LETTERS), 10, 0.2), nrow = nrow, dimnames = list(seq_len(nrow), LETTERS))) ``` ```R # dashboardPage is buggy if (interactive()) { library(shinydashboard) library(shiny) library(DT) shinyApp( ui = dashboardPage( header = dashboardHeader(), sidebar = dashboardSidebar(), body = dashboardBody( fluidRow(column(12, dataTableOutput('tbl'))) ) ), server = function(input, output) { output$tbl = renderDataTable( wide_table, filter="top", rownames=TRUE, options=list(scrollX=TRUE)) } ) } ``` ```R # regular fluidPage works well if (interactive()) { library(shinydashboard) library(shiny) library(DT) shinyApp( ui = fluidPage(fluidRow(column(12, dataTableOutput('tbl')))), server = function(input, output) { output$tbl = renderDataTable( wide_table, filter="top", rownames=TRUE, options=list(scrollX=TRUE)) } ) } ``` ### Describe the problem in detail Considering: - using a `dashboardPage` (as demonstrated above, this issue does not affect `fluidPage`) - a datable with `options=list(scrollX=TRUE)` and `filter="top"` - scroll to the right, to a column initially out of screen - click on the filter input for the column The issue is that upon the last action above, the view of the table header (i.e, column names and top filter inputs) jumps back to the first columns, making it essentially impossible to use the filter input for that column (or any other of those "out of screen" columns). Note that at that moment, the table body (i.e. the cells) stays in the "scrolled right" view, as they were when the filter input was clicked. During that time, the view of the table header is basically desynchronised from the table body. Clicking again on a top filter input makes the table header jump back to the "scrolled right" position, resynchronising them with the table body. Any feedback or bugfix is welcome! Thanks!