Hey @twigz, I’ve tried running a similar code locally, and couldn’t reproduce the issue unfortunately. Please take a look at the code below and see if anything seems off to you.
Here is the view where the uploader API gets imported:
import {JetView} from "webix-jet";
import UploaderModule from "./uploader";
export default class TestView extends JetView {
config() {
return {
rows: [
// here i'm creating a button to call the API, setTimeout() on init() also works
{
view: "button",
value: "Upload",
localId: "test",
click: () => {
this.uploader.showDialog();
}
}
]
};
}
init() {
const config = {
api: true,
upload: "http://test"
};
let upl = new UploaderModule(this.app, config);
this.uploader = this.ui(upl);
}
}
And here is the module itself:
import {JetView} from "webix-jet";
export default class UploaderModule extends JetView {
constructor(app, config) {
super(app);
this._api = config.api;
this._upload = config.upload;
}
config() {
return {
localId: "test",
view: "uploader",
name: "uploader",
apiOnly: this._api,
upload: this._upload,
autosend: true
};
}
showDialog() {
this.getRoot().fileDialog();
}
}
Judging from the error log, either you have an undefined
variable inputs
in one of your functions, or you are referring to a non-existant value in that array. Either way, I would need a bit more details to be able to help you out here.
Also, seeing as you’ve mentioned Firefox, does this issue also occur in other browsers, or just Firefox (I’ve tried running the aforementioned code in Chrome and Firefox, both worked fine)?