Changelog
Source:NEWS.md
shinyjs 2.1.0 (2021-12-20)
CRAN release: 2021-12-23
- New feature: you can now reset all inputs on the page by calling
reset()with no arguments (#222) - New feature: Add a
removeEvent()function which removes events added to HTML elements withonclick()oronevent()(#244) - Fix bug:
disable()did not work on nested download buttons (#223) - Fix bug: Don’t automatically namespace ID arguments in custom extendShinyjs functions (#229)
- Fix bug: ensure that
extendShinyjs()functions don’t overwrite native {shinyjs} functions (#230)
shinyjs 2.0.0 (2020-08-24)
CRAN release: 2020-09-09
- IMPORTANT CHANGE Remove commercial license (it only existed because some big companies asked for it, but it ended up being a bigger headache for 99% of the community)
-
BREAKING CHANGE When using
extendShinyjs(), thefunctionsparameter must always be provided. -
BREAKING CHANGE When using
extendShinyjs(), thescriptpath parameter now behaves like any other Shiny web resource, which means it cannot be loaded from the local file system. The path must be discoverable by the browser, so it either needs to be a public URL, inside awwwfolder, or available viaaddResourcePath(). - New feature: add a
refresh()function (#205) - New feature: add
asisparameter toreset()function, which works like it does in all other functions that supportasis(#146) - Fix bug:
extendShinyjs()now works with any web URL or any resource path (#201) - Fix bug:
reset()didn’t work when a sliderInput was initialized withvalue=NULL(#207) - Remove
V8as a package dependency.
shinyjs 1.1 (2020-01-12)
CRAN release: 2020-01-13
This update was 2 years in the making because it required a lot of testing by users to ensure none of these features cause any regression bugs in real apps.
-
BREAKING CHANGE The
includeShinyjsparameter inruncodeUI()is now deprecated - Fix bug: shinyjs functions used inside a module with a
selectorargument instead of anidargument didn’t work (#175) - Fix bug: shinyjs functions did not work with IDs that had a space in them (#176)
- Fix bug: non-selectize select inputs could not be disabled (#186)
- Fix bug:
click()now works with download buttons (#198) - New feature: added
asisparameter to any function that takes an ID. Whenasis=TRUE, the ID will not be namespaced when inside a module (#118) - New feature: added
idparameter toruncode(), allowing it to work inside Shiny modules (#184) - New feature:
onevent()returns theoffsetXandoffsetYevent properties - New feature:
onevent()accepts apropertiesparameter that allows the user to retrieve additional properties that are not whitelisted by default (#159) - New feature:
hide()/show()now only bubble up the DOM tree to the nearest input container if the current element is an input (#153) - Documentation: added documentation about
useShinyjs()side effects and about includingshinyjsin packages (#182)
shinyjs 1.0 (2018-01-08)
CRAN release: 2018-01-08
- BREAKING CHANGE shiny version 1.0.0 is now required
-
BREAKING CHANGE All
colourInput-related functions are now defunct because they are now in thecolourpickerpackage - Added
click()function that simulates a user clicking on a button - Bug fix:
reset()wasn’t working on checkboxes/select inputs that had a comma in the value (#130) - Bug fix: using
disabled()on certain non-standard inputs (such asshinyFiles) had strange behaviour (#120) - Bug fix:
logjs()+showLog()wasn’t working when app first runs - Bug fix:
reset()wasn’t working on file inputs with an ID that contained a dot (#140) - Moved default values of parameters to the R layer instead of being defined in javascript. This means that RStudio no longer complains of missing arguments and that autocompletion will show default values. (#80)
- Improve efficiency of
delay()andreset()functions - Improve documentation and website (https://deanattali.com/shinyjs)
shinyjs 0.9
CRAN release: 2016-12-26
2016-12-26
- added support for shinyAce editor as the input for
runcodeUI()(#93) -
showLog()no longer needs to be specified inuseShinyjs(), and it can be used by just calling it in the server code once (#105) - fixed bug where
showLog()would only show the last message if multiple messages were printed in succession (#99) - fixed bug where date inputs could not be reset to empty (#100)
- fixed textArea inputs not getting disabled when disabling a parent element
- add
showElement()/hideElement()/toggleElement()andaddCssClassetc functions as synonyms for functions that are masked by S4 (compromise for #81) - fixed broken
runExample("sandbox")example - added a website for shinyjs: https://deanattali.com/shinyjs/
shinyjs 0.8
CRAN release: 2016-11-03
2016-11-03
- added
runcodeUI()andruncodeServer()functions that you can add to your app in order to run arbitrary R code interactively - added
showLog()function which lets you redirect all JavaScript logging statements to the R console, to make it easier and quicker to debug apps without having to open the JS console (#88) -
onclickandoneventnow support callback functions, and the JavaScript Event object is passed to the callback (#92) - the
reset()function now works on file inputs - added
alert()as an alias forinfo()
shinyjs 0.7
CRAN release: 2016-08-21
2016-08-20
- All the colourpicker/colourInput related functions are now deprecated because I’ve made a more appropriate package for them
colourpicker - Use updated colourpicker JS library that fixes bugs with new jquery version
- Add reset support for
passwordInputandtextAreaInput(#78)
shinyjs 0.6.2
2016-07-25
- Improved UI of demo shiny apps and added social media meta tags and github fork ribbons
shinyjs 0.5.3
2016-04-05
- Fixed bug with
extendShinyjs()where it didn’t work when using a script and didn’t haveV8installed (#64)
shinyjs 0.5.2
CRAN release: 2016-03-27
2016-03-25
- Added
numColsparameter to thecolourPicker()gadget
shinyjs 0.5.1
2016-03-23
- Added
returnNameparameter tocolourInput(), which lets you get an R colour name instead of HEX value as the return value (#62)
shinyjs 0.5.0
CRAN release: 2016-03-19
2016-03-19
- Added an awesome colour picker gadget and addin. Use
colourPicker()to open a gadget that lets you pick colours, or choose Colour Picker from the Addins menu to run it.
shinyjs 0.4.1
2016-01-31
-
html()function: don’t attempt to change innerHTML if the element does not exist
shinyjs 0.4.0
CRAN release: 2016-01-21
2016-01-16
BREAKING CHANGE: the
textfunction has been renamed tohtml(#42)shinyjs now works with the new modules feature of Shiny (#50)
Refactor how shinyjs R engine works: instead of using cool meta programming that minimizes code and sends each shinyjs function request straight to JS, add a thin layer or R code for each function. This allows us to check the arguments, run custom code for each function, it allows the documentation to show the arguments instead of them being
..., and it fixes a few edge cases of calling shinyjs functions, such as calling shinyjs usingdo.call()(#51)Update vignette/readme to include FAQ
Change internally the name of shinyjs functions to make the JavaScript function names more unique to avoid potential conflicts with user-defined JS functions
shinyjs 0.3.0
CRAN release: 2015-12-30
2015-12-30
- bug fix:
hidden()now works when used on an element with adisplayCSS property
shinyjs 0.2.2
2015-09-15
- added
htmlargument touseShinyjs(), which adds support for using shinyjs in shiny apps that are built with index.html instead of using Shiny UI (more details in the README) - refactored internally how shinyjs resources are handled so that the resource path is now prefixed with “shinyjs” or “shinyjs-extend” instead of a random string
shinyjs 0.2.1
2015-09-13
- add a
debugparameter touseShinyjsthat will cause detailed debugging messages to be printed to the JavaScript console when turned on
shinyjs 0.1.4
2015-09-05
- refactor JavaScript code to remove code duplication and add better internal documentation
- bug fix:
disablednow works with all input types - bug fix:
enable/disabledid not work onselectInput,sliderInput, andactionButton - bug fix: resetting a slider input with a range did not reset the end point, only the start point
shinyjs 0.1.3
2015-09-05
-
onclickandoneventnow work with dynamically generated elements. Not a trivial fix, but enough people requested it that it was important
shinyjs 0.1.2
2015-09-04
Lots of big changes
- added
delayfunction, which allows you to run code after a specified amount of time has elapsed -
BREAKING CHANGE - removed
delayparameter fromhide/show/togglebecause the same behaviour can now be achieved using thedelayfunction (if you previously usedshow(id = "text", delay = 2), you can now usedelay(2000, show("text"))) - added
oneventfunction, which is similar toonclickbut can be used for many other different events -
resetnow works with dynamically generated elements (inputs that are created withrenderUI) - make
disabledwork for dynamically generated elements - removed defunc
resettablefunction
shinyjs 0.1.1
2015-08-19
- better debugging: when a shinyjs JavaScript function is called with a mix of both named and unnamed arguments (which is not allowed), tell the user what function exactly was called. This is done because sometimes a different package doesn’t properly namespace its function calls and end up accidentally calling shinyjs functions, which results in weird bugs.
- add comments to the
onclickdocumentation, to make it clear that it can’t work with dynamic UIs - improved documentation
shinyjs 0.1.0
CRAN release: 2015-08-13
2015-08-12
- add support for
shinyjs.initfunction when usingextendShinyjsthat runs when the page loads. This provides the user a way to register event handlers or do some initializations that automatically run on page load rather than calling it manually in the server - add
disabledfunction that initializes a Shiny input in a disabled state - add a
rmdparameter touseShinyjsthat lets you use shinyjs inside interactive R markdown documents (default is FALSE to favour regular Shiny apps) - the bulk of the shinyjs JavaScript code is no longer embeded in the HTML as text and is instead linked to as a file. This makes the Shiny app’s HTML much cleaner and smaller
- use htmltools dependency system for handling javascript/css dependencies
shinyjs 0.0.8.3
CRAN release: 2015-07-31
2015-07-30
-
disable/enablenow work fordownloadButtonelements
shinyjs 0.0.8.2
2015-07-23
- You no longer need to define the server function with the
sessionparameter! A shiny server function defined asserver = function(input, output) {...}can work withshinyjs
shinyjs 0.0.8.1
2015-07-17
- Fix bug where periods in element names weren’t working for some shinyjs functions
shinyjs 0.0.8.0
2015-06-30
- added an option to allow only a predefined list of colours to select from in
colourInput(feature request from Hadley and other Twitter users)
shinyjs 0.0.7.0
CRAN release: 2015-06-25
2015-06-23
- add
selectorparam to thedisable/enable/toggleStatefunctions and theaddClass/removeClass/toggleClassfunctions so that multiple elements can be targeted in batch - added
transparentTextparam tocolourInput
shinyjs 0.0.6.6
2015-06-22
- added a demo app using
colourInputthat’s available viarunExampleand on my shiny server - add a transparency option to
colourInput - complete refactor of
colourInputusing a better library that I modified to work well with shiny inputs - including multiple
useShinyjs()orextendShinyjs()will not result in duplicated HTML anymore. This can be useful if the UI is including a few external UI pieces and they independently make a call touseShinyjs().
shinyjs 0.0.6.5
2015-06-17
- added
colourInputthat can be used as an input element to select colours, and its correspondingupdateColourInput. This doesn’t really fit theshinyjsmodel of running JS functions, this feels like something very different from the rest of the functions in this package, it might move somewhere else in the future.
shinyjs 0.0.6.4
2015-05-30
hiddencan now accept multiple tags or a tagList or a list of tags (previously only a single tags was allowed)allow
hide/show/toggleto be run on any JQuery selector, not only on a single ID
shinyjs 0.0.6.3
2015-05-28
- added
delayargument tohide/show/toggleso that you can now hide or show an element after a short delay instead of immediately. Useful for showing a message for a few seconds and then fading it away.
shinyjs 0.0.6.2
CRAN release: 2015-05-29
2015-05-27
- added
textargument toextendShinyjsso that JavaScript code can be provided as a string instead of in a separate file. Useful if your JS code is very short and simple and you don’t want to create a new file
shinyjs 0.0.6.0
CRAN release: 2015-05-26
2015-05-25
add
extendShinyjsfunction - allow users to add their own JavaScript functions that can be called as if they are regular R codedisableandenablenow work for ALL shiny input typesshowandhidenow work for any HTML tag including all shiny input typesbetter
onclickbehaviour - when set on a shiny input, trigger the event when any part of the input is clickedimprove implementation of
resetand simplify function call to it
shinyjs 0.0.5.0
2015-05-23
add
resetfunction that allows input elements to be reset to their original valuesadd function
runjsto run arbitrary javascript code (not recommended to use in published shiny apps)relax R version requirement to 3.1.0
look for session object in all parent frames, so that shinyjs functions can work from helper functions and not only from within the main server function
refacor internal code
update example apps and vignette to include
resetfunction andconditionparam intogglefunctions
shinyjs 0.0.4.0
2015-04-24
add a
conditionargument totoggle/toggleState/toggleClassthat allows you to pass a boolean condition to determine if to show/hide (enable/disable, etc) based on that condition. Useful to do things liketoggleState(id = "submitBtn", condition = nchar(input$text) >= 3)fix
hiddenso that if there are elements created dynamically usingrenderUI, shiny will render them when they are made visiblebetter implementation of
toggleusing
enable/disable/toggleStateon a selectize input worksbetter implementation of
toggleState
shinyjs 0.0.3.0
2015-04-18
bugfixes to
onclick()(evaluate expressions in the correct environment)rename
alert()toinfo()because when the app was deployed in a Shiny Server (shinyapps.io or my own shiny server), it was printing the alret twice - probably because shiny server somehow intercepts thealertcall toorename
innerHTML()totext()to make it more understandable for the average useradd
addparam toonclick()add
addparam totext()add
inlineCSS()function to easily add inline CSS to a Shiny appadd documentation to all functions
add “demo” example app that provides a safe way to experiment with shinyjs by providing a predetermined set of functions to run
add “basic” example app that shows how some
shinyjsfunctions can be used together in a real (very simply) Shiny appadd vignette and README, get ready for CRAN submission
shinyjs 0.0.2.1
2015-04-02
New function: onclick - allows the user to run an R expression (including shinyjs expressions) when a specific element in the Shiny app is clicked.
shinyjs 0.0.2.0
2015-04-02
The user is no longer required to set the shiny session or to pass it into any function calls. Every shinyjs function will try to dynamically figure out the correct Shiny session to use. The previous code with explicit sessions is still in the codebase but has been commented out so that it’ll be easy to switch back to it in the near future in case the new approach doesn’t always work.
This has been a pending change for a while but I was hesitant to use it because I still don’t fully understand the call stack and I’m not 100% sure this will always be correct. But it does make sense to me and it seems to work so I’ll give it a go.