Skip to content

Commit

Permalink
Fixed FileInput breaks if both MaxWidth and MaxHeight is set and a no…
Browse files Browse the repository at this point in the history
…n image is selected

Fix #1922
  • Loading branch information
enchev committed Feb 6, 2025
1 parent c6a8d80 commit c380634
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Radzen.Blazor/wwwroot/Radzen.Blazor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ window.Radzen = {
reader.addEventListener(
'load',
function () {
if (maxWidth > 0 && maxHeight > 0) {
if (fileInput.files[0] && fileInput.files[0].type.includes('image') && maxWidth > 0 && maxHeight > 0) {
var img = document.createElement("img");
img.onload = function (event) {
// Dynamically create a canvas element
Expand Down

0 comments on commit c380634

Please sign in to comment.