Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadzenFileInput breaks if both MaxWidth and MaxHeight is set and a non image is selected #1922

Open
HeruEwasham opened this issue Jan 23, 2025 · 0 comments

Comments

@HeruEwasham
Copy link

HeruEwasham commented Jan 23, 2025

Describe the bug
If you decide to specify both the MaxWidth and MaxHeight, and try to select a non-image, like an mp3- or text-file, it will not work, but will not give you an error either. But if either MaxHeight or MaxWidth is omitted, it works as expected/normal for non-image-files.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the official demo: https://blazor.radzen.com/fileinput?theme=material3
  2. Click to edit the source of one of the examples.
  3. Add both a MaxWidth-, a MaxHeight-, and an Accept-attribute to the RadzenFileInput-component. The Accept-attribute is needed to allow you to set something else than images. Example: ´MaxHeight="500" MaxWidth="500" Accept="text/,audio/,image/*"´
  4. Click Run
  5. Select an image-file, and see that the Change-event logs to the Console-log
  6. Select a non-image file.
  7. See that things don't work. The Change-event will for instance not be triggered.
  8. if you edit away MaxHeigth or MaxWidth, and run it again, and try a non-image, everything works as expected.

Expected behavior
I Expect that even if I decide to add both a MaxWidth and a MaxHeight, It will still work as expected for all the different files.

Screenshots
It is better to experience it.

Desktop (please complete the following information):

  • OS: Experienced on both Windows and Mac
  • Browser Tried both Safari, Edge and Chrome, etc.
  • Version ....

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant