-
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
[Tiny PR] Text patterns: fix undo after mouse move #18533
Conversation
// Undoing an automatic change should still be possible after mouse | ||
// move. | ||
case 'STOP_TYPING': | ||
return state; | ||
} | ||
|
||
// Reset the state by default (for any action not handled). |
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 think the root problem here is that this is dangerous in reducers in general. I'm pretty sure this error can happen again if we introduce new random actions. That said, now we have an e2e test to be aware of it at least.
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.
Right, a newly introduced action might need to be added here, but it's more likely that it shouldn't be added here. If we do the opposite, it might be that we do the wrong action on Backspace
, which I think is worse. I think it's better to whitelist the actions that should be ignored (which there are way less of).
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.
While this fixes the issue, the fact that the caret is not in the paragraph after the undo is disturbing but I guess this is a different issue.
@youknowriad Right, there a separate PR for that: #17824. Looks like one e2e test needs to be fixed and needs a rebase, but is otherwise looking good. I'll try to fix it sometime soon. |
A transformation e2e tests seem to be consistently failing... and I have no idea why. It seems to be around the full site editing blocks. @jorgefilipecosta or @epiqueras Do you have any idea?
|
Hi @ellatrix, I'm submitting a fix. |
Thank you @jorgefilipecosta ! Sorry, I read the failures too quickly and thought they were the unrelated group transform failures PRs always get. |
58ee6bc
to
44c3017
Compare
Thanks for the review, @youknowriad! |
Description
Fixes #18492.
How has this been tested?
1.
inside a paragraph. The block should convert to a list block.Backspace
. The block transform should be undone.Screenshots
Types of changes
Checklist: