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

Cropper: behavior on invalid Source #5916

Merged
merged 3 commits into from
Dec 30, 2024
Merged

Conversation

tesar-tech
Copy link
Collaborator

Description

Mentioned in #5847

This PR aims to improve the behavior on invalid Source in the image cropper. The behavior mentioned in #5847 isn't actually that bad—nothing crashes, and the "transparency grid" is a good indication that something went wrong.

Introduced in this PR:

  • On an invalid Source, the cropper is disabled (and the previous state is re-enabled when the Source is fixed).
  • Source now has the EditorRequired attribute as it is the only way to signal to users that it's required. I don't see any reason not to use it, but I also don't see it used anywhere else. So..?
  • The ImageLoadingFailed event was added to inform users when something goes wrong with image loading. Ensuring the Source is correct remains the user's responsibility, but this helps handle such cases.

(invalid source includes null, "" or "image/that/does/not/exist.jpg")

@tesar-tech tesar-tech requested a review from stsrki December 27, 2024 22:08
@stsrki stsrki merged commit d7b8f02 into rel-1.7 Dec 30, 2024
2 checks passed
@stsrki stsrki deleted the sup/rel-1.7/Cropper-on-null-source branch December 30, 2024 09:41
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants