-
Notifications
You must be signed in to change notification settings - Fork 4.1k
add support for paste events #1603
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
Conversation
@@ -222,6 +222,12 @@ class AbstractChosen | |||
# don't do anything on these keys | |||
else this.results_search() | |||
|
|||
paste_checker: (evt) -> | |||
chosen = this | |||
callback = -> |
There was a problem hiding this comment.
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
@daveworth Can you squash this down to one logical commit? Instructions. Thanks! |
Done. Thanks! |
callback = => | ||
this.results_search() | ||
setTimeout(callback, 50) | ||
|
There was a problem hiding this comment.
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
I think the same kind of callback should be triggered when cutting text from the input. |
@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.
@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. 😄 |
Cool, thanks! |
@pfiller ping! |
Thanks @daveworth - I am going to go paste some stuff right now! |
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 ifthat copy had just been typed into the box manually.
This is meant to address #1601 opened by me today.