[ticket/17648] Keep avatar cropper within its box for large size limits#6994
Open
ECYaz wants to merge 1 commit into
Open
[ticket/17648] Keep avatar cropper within its box for large size limits#6994ECYaz wants to merge 1 commit into
ECYaz wants to merge 1 commit into
Conversation
The cropper container is forced to twice the maximum allowed avatar size. With large limits this exceeds the avatar box, which is capped at 400px height in the UCP, so the cropper overlays the form fields below it, and on narrow layouts the forced width makes it overflow sideways over adjacent content. Cap the workspace at the box's own width and maximum height so it can never leave the box. PHPBB-17648
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17648
The avatar cropper container is forced to twice the maximum allowed avatar size. With larger limits this exceeds the avatar box: in the UCP the box is capped at 400px height with visible overflow, so any limit above 200px pushes the cropper out of the box and it overlays the delete checkbox and the avatar type selection below. On narrow layouts the forced width has the same effect sideways — in the ACP at smaller window sizes a 250px limit forces a 500px wide cropper into a 278px wide box, spilling over the adjacent content. This is what makes the problem appear from around 150px limits on smaller screens.
Capping the doubled workspace at the box's own width and computed maximum height keeps the cropper inside the box in every case while leaving the stylesheet as the single source of truth — the ACP box has no height cap and keeps its natural growth. Verified on a live board: with a 250px limit the cropper now fills the box exactly with no overflow in UCP and ACP, and an upload still saves the avatar at the full 250px dimensions, since crop coordinates map to image pixels rather than container pixels. With the default 120px limit the computed minimums are unchanged from before and the cropper renders identically.