-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix bottom margin jump on focus #15795
base: master
Are you sure you want to change the base?
Conversation
@brandonkelly could you provide some visual (video would be great) of the before and after, so that we are 100% on the same page. cc @oleq @pszczesniak |
Sure! Here’s a CKEditor field that ends with a CleanShot.2024-02-05.at.05.00.02-trimmed.mp4It’s subtle, but if you look closely you’ll see the editor shrinks by a few pixels when focused due to the difference between those margins. With my PR, it no longer matters what elements’ normal margins are. They will get the same CleanShot.2024-02-05.at.05.10.03.mp4 |
@vokiel could you verify CLA? |
Confirmed. Proper status set. |
The PR looks good to me (both the functionality and the code). Can we run it by the QA team @Witoso just to stay on the safe side? |
Yep, we can do it. |
@ckeditor/qa-team Can you take a look at this PR, please? |
Sure, we will take a look at this 👍 |
Bottom margin jumps with certain styles appliedSteps
Result1.mp4Alternative scenario
Result2.mp4Additional infoIt's a regression - doesn't reproduce on master |
We've tested the PR with @marcelmroz and @kubaklatt and have found one regression that it introduces, which occurs when certain styles are used and is reported above. Besides that, the fix looks good and resolves the initial issue 👍 |
Suggested merge commit message (convention)
Fix: Bottom margin jumps on focus. Closes #15859
Additional information
This fixes a bug where the bottom padding of the editor will jump on focus, because the
.ck-fake-selection-container
element is added, which is fixed-positioned, but drops themargin-bottom
styling from whatever was the:last-child
.It uses the
:has
selector, which is widely available now.Related issues: