Revolutionary virtual selection input enhancing the capabilities of Reactable

In the image below, you can see that the options of virtualselectinput are being covered by the reactable table below. I need the virtualselectinput and its options to always stay on top of the reactable table. How can I write the CSS to solve this issue?

https://i.sstatic.net/51vTaSoH.png

library(shiny)
library(shinyWidgets)
library(reactable)

shinyApp(

    ui = fluidPage(


        shinyjs::useShinyjs(),

        navbarPage(title = "Example", id = "NavBarPage", collapsible = TRUE,

            tabPanel("tabPanel 1", value = "tabPanel_1",

                # uiOutput("ui_for_tabpanel_1"),
                
                fluidPage(

                    fluidRow(

                        column(2,

                           virtualSelectInput(
                               inputId = "selection_A",
                               label = "Select A: ",
                               choices = rownames(mtcars),
                               search = TRUE,
                               multiple = TRUE,
                               showSelectedOptionsFirst = TRUE,
                               maxValues = 1000 
                           ),

                              ),

                        column(2,

                           selectInput(inputId = "watchlists", "Select B: ", 
                                       choices = c("A", "B", "C", "D", "E", "F", "G", "H", "I"))

                              ),

                        column(2,

                            virtualSelectInput(
                                inputId = "symbols_selected_watchlist",
                                label = "Select C: ",
                                choices = rownames(mtcars),
                                search = TRUE,
                                multiple = TRUE,
                                showSelectedOptionsFirst = TRUE,
                                maxValues = 1000
                            ),

                            ),

                    ),

                    tags$br(), tags$br(), tags$br(), tags$br(),

                    reactableOutput("table_A"),

                    )

            ),

            )

    ),

  server = function(input, output, session) {
    
      output$table_A <- renderReactable({

          reactable(mtcars,
                    fullWidth = TRUE, compact = TRUE, highlight = TRUE,
                    striped = TRUE, filterable = TRUE,
                    pagination = TRUE, showPageSizeOptions = TRUE, defaultPageSize = 100,
                    height = 800,
                    selection = "single", onClick = "select",
                    theme = reactableTheme(

                        rowSelectedStyle = list(backgroundColor = "#808080", boxShadow = "inset 2px 0 0 0 #ffa62d")

                    )
          )

      })

    }
)

Answer №1

To make adjustments to the dropdown menu, we'll need to tweak the z-index. It's important to set this number quite high.

The z-index CSS property determines the stacking order of positioned elements and their children or flex items. Elements with a higher z-index will cover those with a lower value.

tags$style(HTML(".vscomp-dropbox-container  {z-index:99999 !important;}"))

library(shiny)
library(shinyWidgets)
library(reactable)

shinyApp(
  ui = fluidPage(
    shinyjs::useShinyjs(),
    navbarPage(title = "Example", id = "NavBarPage", collapsible = TRUE,
               tabPanel("tabPanel 1", value = "tabPanel_1",
                        tags$style(HTML(".vscomp-dropbox-container  {z-index:99999 !important;}")),
                        fluidPage(
                          fluidRow(
                            column(2,
                                   virtualSelectInput(
                                     inputId = "selection_A",
                                     label = "Select A: ",
                                     choices = rownames(mtcars),
                                     search = TRUE,
                                     multiple = TRUE,
                                     showSelectedOptionsFirst = TRUE,
                                     maxValues = 1000 
                                   )
                            ),
                            column(2,
                                   selectInput(inputId = "watchlists", "Select B: ", 
                                               choices = c("A", "B", "C", "D", "E", "F", "G", "H", "I"))),
                            column(2,
                                   virtualSelectInput(
                                     inputId = "symbols_selected_watchlist",
                                     label = "Select C: ",
                                     choices = rownames(mtcars),
                                     search = TRUE,
                                     multiple = TRUE,
                                     showSelectedOptionsFirst = TRUE,
                                     maxValues = 1000))
                            ),
                          tags$br(), tags$br(), tags$br(), tags$br(),
                          reactableOutput("table_A"),
                        )
               )
    )
  ),
  
  server = function(input, output, session) {
    
    output$table_A <- renderReactable({
      
      reactable(mtcars,
                fullWidth = TRUE, compact = TRUE, highlight = TRUE,
                striped = TRUE, filterable = TRUE,
                pagination = TRUE, showPageSizeOptions = TRUE, defaultPageSize = 100,
                height = 800,
                selection = "single", onClick = "select",
                theme = reactableTheme(
                  rowSelectedStyle = list(backgroundColor = "#808080", boxShadow = "inset 2px 0 0 0 #ffa62d")
                  
                )
      )
      
    })
  }
)

https://i.sstatic.net/8mIzk.gif

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to separate strings with multiple semicolons in R?

I am looking to determine the length of a specific text separated by ; following any number. In the given text named txt below, I want to exclude the first two semicolons when counting. To find the length, if the ; follows 6, 5 should be included in the ca ...

Trouble with card alignment in Bootstrap

I've been experimenting with creating a grid layout using cards and utilizing ng-repeat for generating the cards. Unfortunately, I'm running into an issue where there is no spacing between each card, as depicted in the image. https://i.stack.img ...

Having trouble installing the lidR package on a Linux Redhat system

Struggling to utilize the lidR package in RStudio Server as I encounter difficulties installing the 'rlas' dependency. I have included a variable in Makevars like so: CXX14 = g++ -std=c++1y Despite these efforts, errors persist. The console outp ...

Can a callout or indicator be created when a table breaks across columns or pages?

As we develop HTML pages for printing purposes, one specific requirement for tables is to include an indicator like "Continues..." below the table whenever a page or column break occurs. Additionally, in the header of the continuation of the table, we need ...

How to multiply selected rows in R by a specified factor

I am working with a matrix that looks like this: x=matrix(c(1,1,2,2,10,10,20,20,21,21,30,30,31,31,40,40, 101,103,102,103,111,112,120,121,120,121,130,131,130,131,140,141),16,2) My goal is to repeat every two rows of x a specific number of times, ...

Is it possible to modify or delete the question mark in a URL?

Currently, I am working on implementing a search bar for one of my websites hosted on Github. Below is the code I have written for the search bar: <!-- HTML for SEARCH BAR --> <div id="header"> <form id="newsearch" method ...

What methods can be used to determine if y is experiencing a significant decrease or remaining constant as x increases?

Seeking guidance on analyzing the relation between y and x in R to determine if y is significantly decreasing as x increases. y=c(111.8784966,91.79114434,90.02533714,86.30424896,82.35746173,84.31890131) SEy=c(27.43598893,13.38661564,15.35877537,12.9718339 ...

Chrome experiencing issues with css3 animation due to jQuery 1.10

The functionality is compatible with Firefox, but not Chrome. However, it can work on Chrome if jQuery is removed. See demo here: http://jsbin.com/eFUfILI/3/ ...

What is the most effective way to align a thumb to the left and content to the right?

What is considered the optimal method for positioning an image to the left with two text fields to the right of it? Is using floats or positioning better? <li> <a href=""> <img src=""THUMB HERE /> </a> <a href=""> TITLE </ ...

employing iframes dynamically to overlay a webpage

I inserted this iframe into a webpage <iframe src='http://redbug.redrocksoftware.com.au:80/Pages/chamara.html' style="position:absolute;z-index:1;" ></iframe> The chamara.html page has a button that, when clicked, should cover the c ...

Efficient method for carrying out a sequence of tasks in the Tidyverse

I have been coding in a certain manner, but I am now considering if there is a better and more legible way to do it, possibly with tidyverse. Let me elaborate: set.seed(123) a_df=data.frame(sample=sample(c("A","B", "C"), 50, ...

Is Flash consistently positioned above the other elements? Can it be corrected using CSS

Hey there, I just uploaded a video from YouTube onto my website and noticed that the footer, which is fixed, is being overlapped by the video. Is there any way to resolve this issue? Perhaps some CSS tricks or hacks? Any assistance would be highly appreci ...

Dynamic navigation menu shifting when bolded

Looking at my menu, you'll notice the following layout: If one clicks on Recruitment in the menu, it correctly bolds the text as intended. However, an issue arises where the entire menu unexpectedly shifts 1 or 2px to the left. The menu is implemente ...

The colors in the dumbbell plot appear to be blending together in a mismatched manner

I encountered an issue while attempting to create a dumbbell plot in R. My dataset consists of four rows, each needing to be represented by a specific color. I used colorRampPalette() to define the colors within the dataset. However, when generating the pl ...

Encountering a problem with the date time picker drop down in Bootstrap 4 version 4.1.1

Is there anyone who can resolve the dropdown issue in Bootstrap's latest version (v4.1.1)? Alternatively, could you recommend a reliable date time picker that works well with the latest version of Bootstrap? Check out this Codepen Link <section ...

Access a CSS file from a directory other than the main folder

I have an HTML file in the main folder (X-folder) which also contains CSS. I converted the HTML to ASP and now need to put it inside an ASP[Y] folder. My question is, since my CSS file is in the main folder [X], how can I access it from there if I am in th ...

Guide to merging several R scripts into a single document

Situation After dividing my R program into multiple R-files for better code structure, I found that the Main.R file references other R-files using the 'source()' command. For example: source(paste(getwd(), dirname1, 'otherfile1.R', se ...

Error: Improper Number of Icons Assigned in reactablefmtr's icon_assign Function

The code snippet provided should display the count of blue circles (ranging from 0 to 4) based on the responseCount, but it seems to be not functioning as expected. I am unable to pinpoint the exact issue. I would like there to always be a total of 4 circ ...

Is it possible to incorporate this design in a way that is responsive?

Can you share your insights on the best approach to implement this design in a responsive manner? I have a mockup ready for reference, featuring a lovely blue square. Here's the "mobile" version of the design. When the width is reduced to a point whe ...

Using Bootstrap 4 to split lengthy text into multiple columns, similar to how it is done in Microsoft Word

Is there a way in Bootstrap4 to create MS Word-like multicolumn text flow? For example, in Word we have: https://i.sstatic.net/buCXu.png In Bootstrap4, the code below will generate a two-column grid: Example: <div class="row"> <div ...