This repository has been archived by the owner on Oct 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fixed pasting issue with generic ClipboardEvent in tagging mode #910
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…allow pasting even the tagging function is not defined
+1 any chance of this getting merged? |
bump, can someone take look at this fix? |
Actually, #704 is not fixed by this change. To fix this we could add timeout before calling ctrl.select from paste handler, and remove e.preventDefault() from it something like this: ctrl.searchInput.on('paste', function (e) {
var data = e.originalEvent.clipboardData.getData('text/plain');
if (data && data.length > 0 && ctrl.taggingTokens.isActivated && ctrl.tagging.fct) {
var items = data.split(ctrl.taggingTokens.tokens[0]); // split by first token only
if (items && items.length > 0) {
$timeout(function () {
angular.forEach(items, function (item) {
var newItem = ctrl.tagging.fct(item);
if (newItem) {
ctrl.select(newItem, true);
}
});
});
e.stopPropagation();
}
}
}); |
erikdubbelboer
added a commit
to atomx/ui-select
that referenced
this pull request
Oct 26, 2015
Add paste="expression" to allow custom paste handling. Allow pasting in tagging mode when the tagging function is not defined. In IE use window.clipboardData so jQuery is not required. Fixes angular-ui#910, angular-ui#704, angular-ui#789, angular-ui#848, angular-ui#429
erikdubbelboer
added a commit
to atomx/ui-select
that referenced
this pull request
Oct 27, 2015
Add paste="expression" to allow custom paste handling. Allow pasting in tagging mode when the tagging function is not defined. In IE use window.clipboardData so jQuery is not required. Fixes angular-ui#910, angular-ui#704, angular-ui#789, angular-ui#848, angular-ui#429
erikdubbelboer
added a commit
to atomx/ui-select
that referenced
this pull request
Nov 9, 2015
Add paste="expression" to allow custom paste handling. Allow pasting in tagging mode when the tagging function is not defined. In IE use window.clipboardData so jQuery is not required. Fixes angular-ui#910, angular-ui#704, angular-ui#789, angular-ui#848, angular-ui#429
danielgrippi
pushed a commit
to viewthespace/ui-select
that referenced
this pull request
Jan 12, 2016
Add paste="expression" to allow custom paste handling. Allow pasting in tagging mode when the tagging function is not defined. In IE use window.clipboardData so jQuery is not required. Fixes angular-ui#910, angular-ui#704, angular-ui#789, angular-ui#848, angular-ui#429 (cherry picked from commit 5b852b3)
aaronroberson
added a commit
that referenced
this pull request
Feb 18, 2016
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixed pasting issue with generic ClipboardEvent in tagging mode, and allow pasting when the tagging function is not defined.