rstudio / shiny

Easy interactive web applications with R
https://shiny.posit.co/
Other
5.36k stars 1.87k forks source link

Progress with 'closeButton' option #2979

Open dipterix opened 4 years ago

dipterix commented 4 years ago

How can I hide the little x in progress bar? Some of my users think by clicking x, they could interrupt current R, but it's just hiding the UI element. image

ColinFay commented 4 years ago

You can add some CSS to hide it:

.shiny-notification-close {
    display: none;
}
dipterix commented 4 years ago

@ColinFay but that will hide x in other notifications, created by shiny::showNotification. Basically showNotification and shiny progress bar share the same html structure and is unable to tell the difference simply using html class. I might be useful to add different classes to these two types of notifications?

ColinFay commented 4 years ago

I think it would be useful to have it at a function level, something like:

Progress$new(
    session, 
    min=1, 
    max=15, 
    withClose = FALSE
)

Which could be extended to all type of Notifications

billy34 commented 3 years ago

You can hide the close button after progress notification is shown using shinyjs.

  shinyjs::runjs('$(".shiny-notification").has(".progress").children(".shiny-notification-close").hide()')