Issue at the first rendering of a datatable with Shiny

, ,

I have an issue when I launched this shiny app. The "search bar" and the "length menu" of the datatable appear, despite the dom="t" option.
Importantly: This issue appears only when I start the app from a fresh R session (but it is an issue because when I deploy the app on shiny connect, it is mostly from a fresh R session for each user). The issue disappears if I strike Ctrl+F5.

It is a question of timing... but I can't solve it.

shinyApp(
  ui = fluidPage(
    DT::DTOutput("example"),
  ),
   server = function(input, output, session) {
    output$example <- DT::renderDT({
      DT::datatable(data.frame(Column1=1:5), options(dom='t'), 
                    rownames = FALSE, selection = 'none')
    })
  }
)

Thank you for your help.

Update: one trick is to launch a DT::datatable for nothing...

DT::datatable(data.frame(Column1=1:5), options(dom='t'), 
              rownames = FALSE, selection = 'none')
shinyApp(
  ui = fluidPage(
    DT::DTOutput("example"),
  ),
   server = function(input, output, session) {
    output$example <- DT::renderDT({
      DT::datatable(data.frame(Column1=1:5), options(dom='t'), 
                    rownames = FALSE, selection = 'none')
    })
  }
)

sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 26100)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] DT_0.33 shiny_1.10.0

loaded via a namespace (and not attached):
[1] digest_0.6.33 later_1.3.2 R6_2.5.1 httpuv_1.6.13 fastmap_1.2.0 magrittr_2.0.3
[7] cachem_1.1.0 memoise_2.0.1 htmltools_0.5.7 lifecycle_1.0.4 promises_1.3.2 cli_3.6.3
[13] xtable_1.8-4 sass_0.4.8 jquerylib_0.1.4 withr_2.5.2 compiler_4.3.2 rstudioapi_0.17.1
[19] tools_4.3.2 ellipsis_0.3.2 bslib_0.6.1 mime_0.12 yaml_2.3.8 Rcpp_1.0.12
[25] jsonlite_1.8.8 htmlwidgets_1.6.4 rlang_1.1.4 crosstalk_1.2.1