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

backspace / delete not captured #28

Open
webpunk opened this issue Sep 4, 2015 · 3 comments
Open

backspace / delete not captured #28

webpunk opened this issue Sep 4, 2015 · 3 comments

Comments

@webpunk
Copy link

webpunk commented Sep 4, 2015

I am facing the following problem:

  1. start recording on any web page with a text field.
  2. enter "somethinK" in the text field.
  3. user backspace to delete character "k"
  4. enter "g"
  5. stop recording & generate a casper.js test file

When executing this test "somethinKg" will be sent to the text field. Wouldn't it be better to simply use the "onchange" event (instead of the "onkeypress" event) to figure out what has to be send to the text field?

@ebrehault
Copy link
Owner

The onchange event will not work properly, as some events might be triggered while the user is typing, it might be useful to test features like autocompletion for instance.
So we do need to record all the keypress events.
What needs to be fixed is the way we get back the resulting text so backspace are properly processed.

@webpunk
Copy link
Author

webpunk commented Sep 4, 2015

Okay. But keep in mind that this actually would require to process all kinds of keyboard input: backspace, delete, using left / right / text / mark text / unmark text / mouseclick in text / ...

@kensoh
Copy link

kensoh commented Jul 20, 2017

Thanks @ebrehault for making Resurrectio! We exchanged emails some time back when I just made the beta release of a tool base on Resurrectio. @webpunk adding on that I traced the code and found the cause. Resurrectio uses onkeypress event to detect key strokes.

However, backspace and tab will only be registered using other events such as keydown or keyup. As that functionality is not critical for my use case, for now I didn't proceed to add the new events as it might break existing onkeypress behavior. onkeypress is the best approach although it does not cover edge cases such as backspace/tab.

UPDATE - wanted to add that I post the comment not for purpose of expecting action because I know that the repo is not actively maintained now. But want to add troubleshooting notes for references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants