Editor bug concerning file upload?

Editor bug concerning file upload?

widdewidde Posts: 1Questions: 1Answers: 0

Hi!
It seems that there is a bug in Editor 1.5.6 that has to do with file uploads. In IE11 the clearing of the input file value at line 7880 in dataTables.editor.js will trigger another on change event.

    container.find('input[type=file]').on('change', function () {
        Editor.upload( editor, conf, this.files, _buttonText, function (ids) {
            dropCallback.call( editor, ids );

            // Clear the value so change will happen on the next file select,
            // even if it is the same file
            container.find('input[type=file]').val('');
        } );

The second time around this.files will contain no files (as expected) but this is not handled in the Editor.upload function so a Type Mismatch javascript error is triggered on line 3899:

reader.readAsDataURL( files[0] );
 

For Chrome the clearing of the value doesn't seem to trigger the on change event so in this case the Type Mismatch isn't triggered. Is this a bug or have I missed something? -

This discussion has been closed.