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
458 dropdown clear #459
Merged
Merged
458 dropdown clear #459
Conversation
This file contains 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
TymekDev
force-pushed
the
458-dropdown-clear
branch
2 times, most recently
from
March 22, 2024 19:53
dc3e8bc
to
23c37a2
Compare
jakubnowicki
requested changes
Mar 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR breaks the update of dropdown choices:
library(shiny)
library(shiny.semantic)
ui <- semanticPage(
dropdown_input("simple_dropdown", LETTERS[1:5]),
actionButton("simple_button", "Update input to use all letters"),
)
server <- shinyServer(function(input, output, session) {
observeEvent(input$simple_button, {
update_dropdown_input(session, "simple_dropdown", choices = LETTERS)
})
})
shinyApp(ui = ui, server = server)
Prior to this change only multi-selection dropdown could be cleared. This change makes `update_dropdown_input` behavior analogous to `shiny::updateSelectInput`. Note: this is a breaking change. Prior to this commit updating with `character(0)` or `""` did not have any effect.
TymekDev
force-pushed
the
458-dropdown-clear
branch
from
March 25, 2024 20:38
23c37a2
to
0976c23
Compare
@jakubnowicki fixed 👌 |
jakubnowicki
requested changes
Mar 26, 2024
Expected `update_dropdown_input` behavior: - choices != NULL and value == NULL changes choices and clears selection - choices != NULL and value != NULL changes choices and sets selection - value == "" and value == character(0) clear the dropdown - Providing a value not present in choices doesn't change the selection The behavior is uniform between a single-selection and a multi-selection variants. Note: - an empty single-selection `dropdown_input` returns "" (no changes) - an empty multi-selection `dropdown_input` returns NULL (no changes)
jakubnowicki
approved these changes
Apr 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Prior to this change only multi-selection dropdown could be cleared. This change makes
update_dropdown_input
behavior analogous toshiny::updateSelectInput
.Note: this is a breaking change. Prior to this commit updating with
character(0)
or""
did not have any effect.Closes #458
DoD
All interaction with a semantic functions, examples and docs are written from the perspective of the person using or receiving it. They are understandable and helpful to this person.All code has been peer-reviewed before merging into any main branch.All changes have been merged into the main branch we use for development (develop).Any added or touched code follows our style-guide.The entire codebase could be run through a formatter, so I didn't update this single file.