[Tiny PR] Text patterns: fix undo after mouse move#18533
Conversation
| return state; | ||
| } | ||
|
|
||
| // Reset the state by default (for any action not handled). |
There was a problem hiding this comment.
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.
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).
youknowriad
left a comment
There was a problem hiding this comment.
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: