mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: allows to copy/paste a list of | separated values in sk (#11642)
* UX: allows to copy/paste a list of | separated values in sk * fixes tests
This commit is contained in:
@@ -15,4 +15,25 @@ export default SelectKitFilterComponent.extend({
|
||||
}
|
||||
return isEmpty(placeholder) ? "" : I18n.t(placeholder);
|
||||
},
|
||||
|
||||
actions: {
|
||||
onPaste(event) {
|
||||
const data = event.originalEvent.clipboardData;
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parts = data.getData("text").split("|").filter(Boolean);
|
||||
|
||||
if (parts.length > 1) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
this.selectKit.append(parts);
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user