Conversation
|
This PR needs thorough testing due to removing the logic of Important note: Since resizing for non-amp-fit-text Text blocks is broken right now due to #3454 then we should not merge this PR until that one is fixed and we can test properly! |
|
This looks promising! A great reduction of complexity by isolating a key calculation. I will have to look more into this to understand it fully, but it looks like a great effort! |
|
Hmm, just saw that some tests are failing, will look into that tomorrow. |
assets/src/stories-editor/components/resizable-box/test/getPositionAfterResizing.js
Show resolved
Hide resolved
|
One thing I noticed that I was looking into #3444 . The re-resizable component supports minHeight and minWidth. See the docs here. Min height and width are passed |
|
The |
amp-wp/assets/src/stories-editor/components/resizable-box/index.js Lines 187 to 188 in 5799032 Ensuring that the minimum height and width for all the blocks would be respected happens here though: amp-wp/assets/src/stories-editor/components/resizable-box/index.js Lines 181 to 183 in 5799032 |
|
I found the variable name First of all, it would make the below lines more readable if they looked like this Why both with our own logic for min Height and width here? |
We need to determine the |
|
Other than an alignment, the code seems good. Once that change was made, I will approve. |
…alidation-sourcing * 'develop' of github.com:ampproject/amp-wp: (57 commits) Undo over-eager rename of auto_accept_sanitization Rename auto-accept to accept-by-default Rename filter to amp_validation_error_auto_sanitized Fix jumping blocks when changing fonts (#3529) Update dependency browserslist to v4.7.1 (#3551) Make sure that isPageBlock always returns boolean. Fix and improve e2e tests. Remove unnessary check for block. Use shift over access first element of array. Use isPageBlock for cleaner code. Fix minor grammar issues Add docblock for `amp_is_sanitization_auto_accepted` filter Align arrows Update tests to use filter to set sanitization auto acceptance Make AMP_Validation_Manage::is_sanitization_auto_accepted() filterable Remove 'auto_accept_sanitization' option Remove relevant auto-sanitization notices Remove validation handling setting field Add special-case handling for layout=fill when both dimensions are 100% Insert duplicated page as current page. Ensure smooth snap line display (#3514) ...
…twentytwenty-support * 'develop' of github.com:ampproject/amp-wp: (73 commits) Mock HTTP request for Test_AMP_WordPress_TV_Embed_Handler Add test case Fix issues with image display (#3555) Fix infinite loop when uploading videos (#3553) Fix styling on remove button. (#3554) Test for XML processing instruction Undo over-eager rename of auto_accept_sanitization Rename auto-accept to accept-by-default Rename filter to amp_validation_error_auto_sanitized Fix jumping blocks when changing fonts (#3529) Update dependency browserslist to v4.7.1 (#3551) Make sure that isPageBlock always returns boolean. Fix and improve e2e tests. Remove unnessary check for block. Use shift over access first element of array. Use isPageBlock for cleaner code. Fix minor grammar issues Add docblock for `amp_is_sanitization_auto_accepted` filter Align arrows Update tests to use filter to set sanitization auto acceptance Make AMP_Validation_Manage::is_sanitization_auto_accepted() filterable ...
Summary
Fixes #3461
Fixes #3444
This PR creates a helper for getting an updated position after resizing. It also removes some seemingly redundant logic from resizing which seems to fix #3444
Checklist