-
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: take into account container padding #14804
Conversation
Added an e2e test. Thanks to the test I discovered a flaw in in my fix. :) |
Again (different) intermittent failures:
|
The intermittent failures seems to be related to reusable blocks (perhaps not being removed synchronously). Cc @noisysocks @aduth. |
There seem to be a lot more intermittent failures lately, and for many assorted tests rather than a few specific. It does make me wonder if there is some asynchronous behavior introduced somewhere in common interactions, as most of the tests I see failing and their corresponding functionality haven't otherwise been modified recently (including this reusable blocks failure). |
@aduth That may be. I've seen these two in particular fail several times in other PRs. It's hard to guess what's going on. :/ |
Odd; testing this, I see some improvement in that I'm not longer "stuck" in the colored paragraph block, but it sometimes (not always) takes two ArrowUp or ArrowDown to escape from the block. Were you ever able to reproduce the original issue? I can reproduce with the Twentynineteen theme, which you mentioned to be using. I'll try to debug a bit as well... |
In my testing, the issue seems to occur as a result of I feel like I'd seen this before as well, and tracking it back to |
@aduth Thanks, I'll have a closer look soon. |
@aduth It seems like in the case you're mentioned above, where you have to press twice, the ZWNBSP is being inserted. The problem is that it gets inserted at the right edge of a line break element, so the ZWNBSP will visually end up on the next line. It seems to be a limitation of this hack. I'll think about how to solve it. In the meantime, I do think this fixes the original issue? |
@aduth I'm sometimes starting to think that we might be better off using a ZWNBSP as padding for an empty rich text area (and padding if it ends in a line break). Element line breaks bring a lot of bugs with them. Anyway, I think this might be better solved separately. |
The e2e test shows that this PR does fix an issue. If you run it against master, it fails. |
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.
Considering ZWSP as a separate issue, this makes sense on its own to account for the padding.
Thanks! |
* Input Interaction: take into account container padding * Add e2e test
* Input Interaction: take into account container padding * Add e2e test
* Input Interaction: take into account container padding * Add e2e test
Description
Fixes #14702. We need to take into account container padding to see if the caret is at the vertical edge of the container. This is relevant for e.g. paragraphs with a background color.
Why does it work in some themes? In some cases the padding may be small enough to get ignored with the buffer we have added.
How has this been tested?
Ensure cross block navigation works with a paragraph with a background color in e.g. Twenty Fifteen.
Screenshots
Types of changes
Checklist: