Skip to content

Commit

Permalink
Changed the GWT game file import code to use addEventListener instead…
Browse files Browse the repository at this point in the history
… of onchange.
  • Loading branch information
lanceewing committed Apr 7, 2024
1 parent df2239a commit 942cd84
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,8 @@ private final native void showHtmlOpenFileDialog(String type, GwtOpenFileResults
console.log('Finished creating input element of type file');
// The onchange event occurs after a file is chosen.
fileInputElem.onchange = function(event) {
console.log('File input element onchange event triggered.');
console.log('The event object is: ' + event);
// The change event occurs after a file is chosen.
fileInputElem.addEventListener("change", function(event) {
if (this.files.length === 0) {
console.log('No files selected for import');
Expand Down Expand Up @@ -320,7 +317,7 @@ private final native void showHtmlOpenFileDialog(String type, GwtOpenFileResults
[email protected]::onFileResultsReady([Lcom/agifans/agile/gwt/GwtOpenFileResult;)(results);
});
}
};
});
// Trigger the display of the open file dialog.
fileInputElem.click();
Expand Down

0 comments on commit 942cd84

Please sign in to comment.