'Click on R Shiny's numericInputIcon() and entire number is automatically highlighted

Here are two numeric input fields

  1. numericInputIcon()
  2. autonumericInput()

If I single click on the "1000" in the numericInputIcon field the I-beam cursor flashes.

If I single click on the "250" in the autonumericInput field the entire number is highlighted.

How can I get the single-click highlight the entire number behaviour to occur with`numericInputIcon'?

library("shiny")
library("bslib")
library("shinyWidgets")

per_month <- "/mth"

ui <- bootstrapPage(
  # https://bootswatch.com/journal/
  theme = bs_theme(version = 5, "font_scale" = 1.0), 
  div(class = "container-fluid",
      
      div(class = "row",
          div(class="col-4", 
              numericInputIcon(
                inputId = "a",
                label = "a",
                value = 1000,
                min = 0,
                max = 9000,
                width = "160px",
                icon = list(NULL, per_month)
              ),
          ),
          div(class="col-4", 
              autonumericInput(
                inputId = "b", 
                label = "b", 
                value = 250, 
                currencySymbol = "$",
                currencySymbolPlacement = "p",
                decimalPlaces = 0,
                minimumValue = 0,
                maximumValue = 20000,
                width = "250px")
          )
      )
  )
)

server <- function(input, output, session) {
}

shinyApp(ui, server)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source