-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add option to resize Cover Block #17143
Conversation
MY GOLLY! I don't have time to review this today, will look tomorrow. But I think @kjellr wants to look at this. Even from the GIF it also seems clear that we'll want to adjust how the sibling inserter works here. In a related case, a good friend of mine suggested that maybe we adjust the sibling inserter (the plus that appears on hover) to not appear until 2 seconds has passed, something in that vein. Another option is to disable it when the block above has resize handles. Or is selected. There are a few ways to go here, but it feels like a key issue to solve before we roll out such a vertical handle. |
There's some more ideas here for the sibling inserter. I don't think spacing alone is enough: #16646 (comment) |
Wouldn't it make more sense for the drag handle and input to control the |
Wouldn't this be better if it changed the min-height rather than height? Imagine mobile viewports where the content spans more lines because of less horizontal space. Also, does the |
those are some very good points @oxyc that I haven't consider. A second implementation that I didn't upload yet, changes height to min-height, as for the hardcoded min height, I guess I should differ to something more absolute, 20 or 50px sounds reasonable to not get a invisible block and still over wide arrangements. after giving the code a second look, and with @jorgefilipecosta review, I guess I was just too damn tired yesterday 😅 |
I've changed the behavior, 430 is not the min height now but the default one. in the future we might abstract it even more to be a theme option, if there is a better option for now I'm all ears to implement it. the new min value is arbitrarily set to 50px, no strong feeling toward this value, just seemed small enough to not restrict and big enough so the cover is not invisible. Also now we change the min height & not the height, should fix a lot of compatibility problems. the input logic has been heavily inspired (read: literally copied & changed variable names) from the spacer block #14785, thank you @Jackie6 & @talldan for the awesome work solving all of those problems for me before hand. I think this is ready for a final review |
@jasmussen you know, this bug bothered me for the past 4 days and I didn't quite knew how to fix, but then you mentioned it and suddenly I knew the source of the problem & how to fix. Please comment more on my problems 😂 |
Solid work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work @senadir 👍 The code changes look good!
Here are some possible improvements I noticed:
- We are setting a min-height, and it works great on the frontend on the editor thought it looks as if we are setting a height. If the content is bigger than the height, we set the height does not expand. We may need to configure the style generation of resizeable (something similar to what happened with media & text).
- If I resize a cover block, a min-height will always be set from now on. There is nothing I can do to avoid setting a min-height after applying some resizing operation. We probably need some mechanism to allow a reset.
* add resize support to cover block * add height settings to option * fix issue with setting min height * fix deleted file * change from height to minHeight * refactor how changes are handled * fix problem with resizing to smaller sizes
* add resize support to cover block * add height settings to option * fix issue with setting min height * fix deleted file * change from height to minHeight * refactor how changes are handled * fix problem with resizing to smaller sizes
* add resize support to cover block * add height settings to option * fix issue with setting min height * fix deleted file * change from height to minHeight * refactor how changes are handled * fix problem with resizing to smaller sizes
Description
closes #17113
This PR adds resizing to Cover block & an option to manually select the value.
after #17113 is merged, I need to rebase this PR around it.
How has this been tested?
Screenshots