Add option to set initial selected values in select_group_ui if supplied in params#113
Merged
pvictor merged 1 commit intodreamRs:masterfrom Apr 1, 2025
Merged
Add option to set initial selected values in select_group_ui if supplied in params#113pvictor merged 1 commit intodreamRs:masterfrom
pvictor merged 1 commit intodreamRs:masterfrom
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #113 +/- ##
==========================================
- Coverage 49.35% 47.07% -2.28%
==========================================
Files 20 21 +1
Lines 3096 4346 +1250
==========================================
+ Hits 1528 2046 +518
- Misses 1568 2300 +732 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Great! Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry I'm using the new Air code formatter so most of these changes are formatting. The only meaningful change is line 62 and 63.
If we pass
input$selectedfrom the params list to both choices and selected arguments, the virtual select input will render with these initial options already selected, then the server will update the choices options with all those found in the data, maintaining the initial selection (as long as the values are found in the data). If no selected value is passed in params we get the same behavior as before withNULLbeing initially passed to choices and selected.This fulfills the request in #107 and avoids having to do this from the server which has the issue of initially still returning an unfiltered data frame before inputs are updated with selected values.
Example: