Skip to content

Conversation

daveworth
Copy link

A short delay (currently 50ms) is required after the paste event for the
pasted text to enter the textbox. Then we can trigger a keyup event as if
that copy had just been typed into the box manually.

This is meant to address #1601 opened by me today.

@@ -222,6 +222,12 @@ class AbstractChosen
# don't do anything on these keys
else this.results_search()

paste_checker: (evt) ->
chosen = this
callback = ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use => and you will not need chosen = this anymore

@tjschuck
Copy link
Member

@daveworth Can you squash this down to one logical commit? Instructions.

Thanks!

@daveworth
Copy link
Author

Done. Thanks!

callback = =>
this.results_search()
setTimeout(callback, 50)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for the extra callback var:

setTimeout (=> this.results_search()), 50

@koenpunt
Copy link
Contributor

I think the same kind of callback should be triggered when cutting text from the input.

@daveworth
Copy link
Author

@koenpunt Thanks for the feedback. The local-variable is now kaput.

A short delay (currently 50ms) is required after the paste event for the
pasted text to enter the textbox.  Then we can trigger a `keyup` event as if
that copy had just been typed into the box manually.
@daveworth
Copy link
Author

@koenpunt - and cut events are handled now. Thanks for the feedback and the cut event was a great call. It didn't scratch my itch as paste did so I was blind to it. 😄

@koenpunt
Copy link
Contributor

Cool, thanks! :shipit:

@koenpunt
Copy link
Contributor

@pfiller ping!

pfiller added a commit that referenced this pull request Feb 7, 2014
@pfiller pfiller merged commit 190deeb into harvesthq:master Feb 7, 2014
@pfiller
Copy link
Contributor

pfiller commented Feb 7, 2014

Thanks @daveworth - I am going to go paste some stuff right now!

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

Successfully merging this pull request may close these issues.

5 participants