FIX: Restore support for pasting multiple PM recipients (#11945)
This is a regression from 98201ecc24
.
Meta topic: https://meta.discourse.org/t/-/178167?u=osama.
Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
This commit is contained in:
parent
024f2720f3
commit
db7b7eed9d
|
@ -0,0 +1,35 @@
|
|||
import MultiSelectFilterComponent from "select-kit/components/multi-select/multi-select-filter";
|
||||
|
||||
export default MultiSelectFilterComponent.extend({
|
||||
classNames: ["email-group-user-chooser-filter"],
|
||||
|
||||
actions: {
|
||||
onPaste(event) {
|
||||
const data = event.originalEvent.clipboardData;
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const recipients = [];
|
||||
data
|
||||
.getData("text")
|
||||
.split(/[, \n]+/)
|
||||
.forEach((recipient) => {
|
||||
recipient = recipient.replace(/^@+/, "").trim();
|
||||
if (recipient.length > 0) {
|
||||
recipients.push(recipient);
|
||||
}
|
||||
});
|
||||
|
||||
if (recipients.length > 0) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
this.selectKit.append(recipients);
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
|
@ -12,6 +12,7 @@ export default UserChooserComponent.extend({
|
|||
|
||||
selectKitOptions: {
|
||||
headerComponent: "email-group-user-chooser-header",
|
||||
filterComponent: "email-group-user-chooser-filter",
|
||||
autoWrap: false,
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue