FIX: uses touchstart/mousedown for selected tags (#6268)

It seems to be way more reliable on firefox and safari in the case of hot replaced content not using ember.
This commit is contained in:
Joffrey JAFFEUX 2018-08-14 16:16:13 +02:00 committed by GitHub
parent 216f4c99b0
commit 7290765a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,17 +48,21 @@ export default ComboBox.extend(Tags, {
didInsertElement() {
this._super(...arguments);
this.$(".select-kit-body").on("click", ".selected-tag", event => {
const $button = $(event.target);
this._destroyEvent(event);
this.destroyTags(this.computeContentItem($button.attr("data-value")));
});
this.$(".select-kit-body").on(
"mousedown touchstart",
".selected-tag",
event => {
const $button = $(event.target);
this._destroyEvent(event);
this.destroyTags(this.computeContentItem($button.attr("data-value")));
}
);
},
willDestroyElement() {
this._super(...arguments);
this.$(".select-kit-body").off("click");
this.$(".select-kit-body").off("mousedown touchstart");
},
@computed("hasReachedMaximum")