Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function that informs whether input was updated by user or programmatically + extra controllers #20

Open
krystian8207 opened this issue Jul 12, 2022 · 0 comments

Comments

@krystian8207
Copy link
Member

krystian8207 commented Jul 12, 2022

Sth like:

UI:

controlInput(
  selectInput("letter", "Letter", letters),
  block_user = TRUE/FALSE, # should the input value in server be blocked when updated by user
  block_program = TRUE/FALSE, # should the input value in server be blocked when updated by update* method
  attach_attributes = c(_trigger = TRUE, attrib_name = attrib_value) # attach attributes to the input value (some specials i.e. _trigger that tells whether send by user or update* or custom ones, e.g. class = "form_input")
)

Server:

str(input$letter)
> chr "a"
> - attr(*, "_trigger")= chr "user"

Implementation idea:

  1. Add proper class to the input.
  2. Mark input properly with shiny:inputchanged and shiny:updateinput (+ use event.stopPropagation() where needed).
  3. Attach attributes with registerInputHandlers when loading the package.

Probable issue: To use registerInputHandlers we need to rewrite binding class, is it possible with keeping the standard logic unchanged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant