feat(InputBinding): subscribe callback now supports event priority#4211
Merged
feat(InputBinding): subscribe callback now supports event priority#4211
Conversation
cpsievert
commented
Apr 25, 2025
95f1c08 to
b77ef5e
Compare
b77ef5e to
157d489
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gadenbuie
reviewed
May 2, 2025
Member
This explanation is the first time I've seen If we're updating the API, I'd love to push it in a direction that supports a more readable interface. I.e. in addition to backcompat for callback(true)
callback({ priority: "deferred" })
callback(false)
callback({ priority: "immediate" })
// or now also
callback({priority: "event"}) |
gadenbuie
approved these changes
Jun 17, 2025
Member
gadenbuie
left a comment
There was a problem hiding this comment.
Looks great! Just a small note to make sure the PR includes a demo snippet with the new feature
schloerke
added a commit
that referenced
this pull request
Jul 6, 2025
* main: (32 commits) Revert the addition of spacing between `icon` and `label` in `actionButton()` (#4248) Restrict `icon`/`label` separator spacing to `actionButton()` (#4247) Fix front-end action button label updating logic (#4242) Update news Properly handle undefined value for input subscribe callback (#4243) Start new version (#4241) v1.11.0 release candidate (#4232) Follow up to #3996: fix front-end checkbox label updating logic (#4238) feat(InputBinding): subscribe callback now supports event priority (#4211) Follow up to #3996 when label is unspecified (i.e., NULL), don't include it in the message (#4237) Run routine (#4234) chore: #4175 update jquery-ui to 1.14.1 (#4205) Update jQuery to 3.7.1 (#3969) Fix 404 in example 08_html (shiny.min.css) (#4221) Follow up to #3870: fix location of news item (#4233) Bugfix for error found in tests (#3870) Allow update input labels with HTML (#3996) Adds mirai to documentation (#4230) family->given for R Core authorship (#4222) fix(renderPlot): get interactive plotting working with ggplot2 v4.0 (#4228) ...
vedhav
added a commit
to insightsengineering/teal.widgets
that referenced
this pull request
Jul 30, 2025
Closes #308 The subscribe callback now expects an object with the priority after this PR rstudio/shiny#4211. So, if you update to `shiny v1.11.1` the `draggable_buckets` do not work (the init works, but since the subscribe is broken it does not update). In the future we can think about using [`sortable`](https://rstudio.github.io/sortable/) package to replace a huge chunk of custom css/js code.
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.
Until now, custom input bindings could only pass a boolean value to their subscribe callback. That is, do something similar to this to notify Shiny of a change:
These boolean values map to values of
priority: "deferred"(true) andpriority: "immediate"(false), meaning 'send later & debounce' or 'send now'.With this PR, you can now:
priorityas an object, making the code more readable/explicit (i.e.,callback({priority: "deferred"}){priority: "event"}to always send now, even if the value hasn't changed.For example:
The motivator for adding this is for
input_submit_textarea()in rstudio/bslib#1204, where it feels like the most desirable behavior is to always resend immediately.