How to select last options user selected with shiny checkbox group input control

I have found the solution in the first answer to this question (checkboxGroupInput – set minimum and maximum number of selections – ticks) does not work as expected. The reproducible example is as follows: rm(list = ls()) library(shiny) my_min <- 1 my_max <- 3 ui <- fluidPage( sidebarLayout( sidebarPanel( checkboxGroupInput(“SelecetedVars”, “MyList:”,paste0(“a”,1:5), selected = “a1”) ),…

Details