[WEB] Fix cursor moves several characters when deleting markdowns on multiline message #656
Conversation
There was a problem hiding this comment.
I see that these changes break quick typing a bit, since now we need to pass a slight delay to our tests. I'm worried that on slower devices the required delay will increase, and some bugs may appear :/
Also, there are some more places in our library where the input structure is modified, for example, the insertText function in the main web component. Maybe we also need to add runAfterInteractions there. Can we check if we can remove this delay in any way?
| }); | ||
|
|
||
| test('fast type cursor position', async ({page}) => { | ||
| test.setTimeout(60000); |
There was a problem hiding this comment.
The default test timeout is 30sec, with added delay this test takes ~40sec to run, so I needed to increase the timeout.
There was a problem hiding this comment.
Can we use fake timers instead? https://jestjs.io/docs/timer-mocks
There was a problem hiding this comment.
Can we use fake timers instead? https://jestjs.io/docs/timer-mocks
It's a Playwright, not a jest test.
Maybe we can try to customize the pressSequentially implementation, but I don't feel really strongly about the idea...
The delay I've added is a simulation of human typing. But I understand you concern about slow-performant devices.
I'll check it!
I've tried to do it on Friday but had no luck unfortunately. |
It looks like all of the places that update the input structure use the updateInputStructure method anyway. For example I've also done some testing on the real low-performant device (Android - Redmi Note 7) and haven't had problems, but we def will need to keep an eye on it. |
|
Hello @VickyStash, unfortunately, |
It feels like this PR was reverted by mistake, as the original issue existed on E/App main, but the updates of this PR never reached the main. |
|
Yes, I've tested the issue with and without your PR changes. I've also tested different versions of the Live Markdown, and only when |
Details
Fix cursor moves several characters on android web platform when deleting markdowns on multiline message.
Related Issues
Expensify/App#50687
Expensify/App#57024
Proposal: Expensify/App#50687 (comment)
Manual Tests
WEB
web.mp4
WEB iOS
ios-web.mp4
WEB Android
android-web.mp4
Linked PRs
N/A