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

Question: Multi-Text Input Package #44

Open
JerePlum99 opened this issue Oct 26, 2023 · 3 comments
Open

Question: Multi-Text Input Package #44

JerePlum99 opened this issue Oct 26, 2023 · 3 comments

Comments

@JerePlum99
Copy link

Hello! Really appreciate all the work being done here to aggregate shiny resources! No pressure to reply or resolve this, but I've looked everywhere and figured it was worth asking.

Are you aware of any package or method that could replicate a multi-text input similar to this? My goal is to allow a user to dynamically input search terms, I've though through textInput or selectInput, but I don't want to restrict users to any set choice and am not sure how to similate this. Let me know if you have any knowledge of something like this, no worries if you just close the issue though. Thank you!

image

@ismirsehregal
Copy link
Contributor

ismirsehregal commented Oct 26, 2023

You can simply use shiny::selectizeInput with it's create option activated. Please see my related answer here:

selectizeInput(
      inputId = "selectedPackages",
      label = "Enter R Package Name",
      choices = packagesDF$Package,
      selected = NULL,
      multiple = TRUE,
      width = "100%",
      options = list(
        'plugins' = list('remove_button'),
        'create' = TRUE,
        'persist' = TRUE
      )
    )

PS: in its dev version shiny::selectizeInput gains support for some new plugin options.

@nanxstats
Copy link
Owner

Agreed. If the requirements are mainly about creating new options and removing buttons, then using the selectizeInput() options and plugins would be the simplest solution.

If your requirement is actually much more complicated (such as the "OR" options), then another possibility is using the drag and drop components creatively.

@JerePlum99
Copy link
Author

@ismirsehregal That was exactly what I was looking for, still new to shiny and didn't know this functionality so appreciate you pointing me in the right direction!

@nanxstats Ill have to take a look at the drag and drop tools, the "AND/OR" functionality is on my roadmap but probably too much to figure out now. Thanks for the help!

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

3 participants