Skip to content
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

Weird behaviour when typing into Slate Editor field in Chrome #1956

Closed
tamlyn opened this issue Nov 21, 2017 · 6 comments
Closed

Weird behaviour when typing into Slate Editor field in Chrome #1956

tamlyn opened this issue Nov 21, 2017 · 6 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@tamlyn
Copy link

tamlyn commented Nov 21, 2017

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

When using typeText into a Slate WYSIWYG editor input in Chrome or Safari, the text gets jumbled up.

screenshot

What is the expected behavior?

Text should be input normally, like in FIrefox.

How would you reproduce the current behavior (if this is a bug)?

See this gist https://gist.github.com/tamlyn/08b4be11424f2539d4d5105ceebf3d4d

Provide the test code and the tested page URL (if applicable)

See above

Specify your

  • operating system: MacOS 10.11
  • testcafe version: 0.18.3
  • node.js version: 8.9
@AndreyBelym
Copy link
Contributor

Hello @tamlyn!

I reproduced the issue. You can try paste: true for typing options as a workaround:

.typeText('div[contenteditable=true]', 'This is some text which does not work', { paste: true })

@AlexanderMoskovkin AlexanderMoskovkin added the TYPE: bug The described behavior is considered as wrong (bug). label Nov 21, 2017
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #10 milestone Nov 21, 2017
@benbrandt
Copy link

I'm seeing similar behavior in when using DraftJS. It seems like maybe testcafe is modifying the DOM directly when using typeText, which is then causing React's virtual dom to become out of sync and causing errors to be thrown.

@AlexanderMoskovkin
Copy link
Contributor

Hi @benbrandt, thanks for the info. Have you tried the approach with the paste: true option? Does it work in your case?

@benbrandt
Copy link

paste: true makes it so that it all gets input in the correct order. But then Draft starts throwing errors I think related to this: https://draftjs.org/docs/advanced-topics-issues-and-pitfalls.html#browser-plugins-extensions

@MichaReiser
Copy link

This issue might also be due to race conditions in your react code.
See the draft.js documentation for details.

AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 13, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 18, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 19, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 19, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 19, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 25, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Apr 26, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue May 3, 2018
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue May 4, 2018
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
* [WIP] process TextInput event on typing (closes DevExpress#1956)

* fix textInput dispatch in safari

* fix textInput dispatch in safari

* fix review remarks

* fix user agent module
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

6 participants