This repository has been archived by the owner on Dec 3, 2020. It is now read-only.
Fix #230: Constrain width of entire popup with lower and upper bounds #249
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.
In previous PRs (#214, #215 and #218) CSS fixes were added to partially constrain either the whole popup or sections of it, leaving the 'Undo' section out. This patch puts a min-width and max-width on the whole popup, while flexibly sizing all its child containers, ensuring that the fixes applied in previous PRs remain in place.
Unfortunately, the Overflow menu has a width greater than our ideal popup width of 320px per the UX spec, and that width cannot be controlled by a Web Extension, so I have set the max-width to 400px which will ensure the width of the popup doesn't change whether the toolbar button is in the overflow menu or not (previously, it would be one width when opened from the overflow menu and another width when opened otherwise).
One idea for the future is to try and detect whether the toolbar button is in the overflow menu or not and change classes accordingly via an experimental API, but that seems like overkill for now.