mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Make fileInput trigger shiny:inputchanged. Closes #1511
This commit is contained in:
2
NEWS.md
2
NEWS.md
@@ -18,6 +18,8 @@ in shiny apps. For more info, see the documentation (`?updateQueryString` and `?
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* Fixed ([#1511](https://github.com/rstudio/shiny/issues/1511)): `fileInput`s did not trigger the `shiny:inputchanged` event on the client. ([#1541](https://github.com/rstudio/shiny/pull/1541))
|
||||
|
||||
### Library updates
|
||||
|
||||
* Closed ([#1500](https://github.com/rstudio/shiny/issues/1500)): Updated ion.rangeSlider to 2.1.6. ([#1540](https://github.com/rstudio/shiny/pull/1540))
|
||||
|
||||
@@ -81,6 +81,15 @@ $.extend(FileUploader.prototype, FileProcessor.prototype);
|
||||
function(error) {
|
||||
self.onError(error);
|
||||
});
|
||||
|
||||
// Trigger shiny:inputchanged. Unlike a normal shiny:inputchanged event,
|
||||
// it's not possible to modify the information before the values get
|
||||
// sent to the server.
|
||||
var evt = jQuery.Event("shiny:inputchanged");
|
||||
evt.name = this.id;
|
||||
evt.value = fileInfo;
|
||||
evt.inputType = '';
|
||||
$(document).trigger(evt);
|
||||
};
|
||||
this.onFile = function(file, cont) {
|
||||
var self = this;
|
||||
|
||||
Reference in New Issue
Block a user