-
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
Input Interaction: Arrow keys become stuck in paragraph with background color #14702
Comments
@aduth Is this something that has recently come up (did it work before)? |
It's an issue in WordPress 5.1.1. I haven't checked earlier. Not as recent as some of your latest refactors, I would guess? |
@aduth I cannot reproduce this issue in the latest |
I can still reproduce this in the current master branch, yes. |
@aduth Hm, I followed your steps once again, but I still cannot reproduce. Here's a GIF: |
🤷♂️ Honestly not sure. I've reproduced in multiple browsers (Chrome, Firefox Developer Edition) in multiple sites (local and remote). Maybe worth a third opinion to break the tie on whether this is only affecting me? Someone from @WordPress/gutenberg-core perhaps want to try to see if they can reproduce? |
Very strange... I still cannot reproduce. What theme do you all have enabled? I have Twenty Nineteen enabled. Perhaps it's some CSS issue. |
Ah yes. Oddly enough, this seems to work fine in Twenty Nineteen (and Twenty Fifteen for that matter). I can reproduce in all other themes I've tried though: The Gutenberg Starter theme, Twenty Seventeen, Twenty Sixteen. |
Ah, the difference is that the paragraphs have a margin in those themes, a padding in others. I'll fix it to account for that. |
Actually, that's not it. It's the styled the same way. Maybe the problem is the buffer calculation, not sure. |
From my uninformed perspective, that sounds quite likely. Or, at least last time I had looked at this code, it seemed there were unaccounted factors like padding, line-height, font-size, etc, remarked as well in #12322 (comment) :
If it's not possible to have a perfect calculation of that gap, maybe it's enough as an improvement to at least incorporate (add) container padding, line-height, font-size to the existing buffer? |
I can reproduce in Twenty Seventeen. Not sure it can help, but when I uncheck these paddings in the Chrome dev tools, then arrows navigation works as expected:
|
#14804 fixes this issue, might be worth adding to the release. |
Describe the bug
When a background color is assigned to a paragraph, it is not possible to use ArrowUp or ArrowDown to navigate out of the block.
To Reproduce
Expected behavior
ArrowUp should move focus to the title.
ArrowDown should move focus to the next block.
ArrowLeft and ArrowRight appear to work as expected when at the respective extents of the block content.
This behaves as expected if the paragraph block does not have a background color assigned.
Desktop (please complete the following information):
Additional context
Likely an issue in one of these two functions:
gutenberg/packages/block-editor/src/components/writing-flow/index.js
Line 222 in 3214cb4
gutenberg/packages/dom/src/dom.js
Line 172 in 3214cb4
cc @ellatrix
The text was updated successfully, but these errors were encountered: