-
-
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
Block toolbar buttons do not scroll with editor content if block toolbar is added manually #16685
Conversation
Appears to be working correctly now. |
Should or does? 😄 If it does, please add it to "Closes" so we know that this PR should also be tested against that issue. As for manual testing:
|
One more thing for the QA team: Could you test this solution on a larger page with a lot of content and see if there's some impact on performance? Testing it in some sample in the docs might be a good idea, but demos on ckeditor.com might be even better. |
I updated description. I'm not sure if we should add it to
Ok, it's only about manually adjust height of block toolbar container. I'll add manual test to cover that. |
And one more thing for clarity: This PR adds "clipping" of the block toolbar icon. So, when it reaches the edge of a scrollable container, we start to cut off the part that overflows its vertical boundaries. This is a very interesting approach. It wasn't necessarily in the scope of this issue, but seems fine. @oleq, I think this deserves your attention :) Question I'd have to you is: do you see any significant risks (apart from performance) in this approach? |
OK, I found the first issue. A clipped button is not clickable: You cannot click it now. It does not react to hover. Meaning – it's kind of useless and confusing this way. Which makes the clipping a bit pointless :( In my opinion, it'd be better, to be honest, to just hide the button once it cannot be clicked. Unless it's caused by this line and may be slightly improved. PS. I'll add that I started checking "clickability" because I was curious whether this button does not actually get pointer events when it's invisible (and floating somewhere over surrounding content). |
@Reinmar It was intended to be clickable, so this line seems broken somehow. Thanks for pointing out, I'll check that. |
@Reinmar Indeed, this line was wrong. It was only about inversion of compare. I slightly renamed this method and made it more obvious. Should be working properly. One thing besides that - I forgot about A11y. I adjusted PR to change |
With this setup of editor elements: <div style="max-height: 300px; max-width: 300px; overflow: auto;">
<div id="editor-scrollable">
...
</div>
</div> the issue is still reproducible. I suspect that there might be setups where the "bounding" element is not the editor itself but something higher up in the element tree, is it possible to calculate the viewport in these cases? |
@lkszzajac Nice catch! I managed to fix that in a recent commit. Can you take a look? I added manual test to cover this case. |
Tested successfully by QA. I added few more tests and assertion to prevent performance issue. |
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.
I'd suggest movin the manual tests to the UI package as it does not require rebuilding the build and also is not related to the build itself but the feature provided by the UI package.
@niegowski I applied your CR suggestions.
After removal of Can you check again? |
I'll merge it after QA retest. |
We have re-tested the PR with @marcelmroz and @kubaklatt, and it looks good. The initial issue doesn't reproduce anymore and we haven't found any regressions either 👍 |
@charlttsie Cool! I'll merge it. |
Suggested merge commit message (convention)
Fix (ui): Block toolbar button no longer remains fixed in the same position while scrolling the editable content. Closes #5460.
Additional information
Closes: ckeditor/ckeditor5-builder#676
ui
calledscrollable-blocktoolbar
Screens
Before
block-toolbar-button-scroll-before-fix-2024-07-08_14.45.06.mp4
After
block-toolbar-button-scroll-fix-2024-07-08_14.41.10.mp4