From a45d8a69f951936bd6fcd429d90ff5ae2b60c9d2 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 23 May 2018 19:04:26 +0200 Subject: [PATCH] FIX: prevents &hellip from being displayed in title attribute --- .../components/select-kit/select-kit-header.js.es6 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js.es6 b/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js.es6 index d719c1ca66a..207de3259fa 100644 --- a/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js.es6 +++ b/app/assets/javascripts/select-kit/components/select-kit/select-kit-header.js.es6 @@ -9,7 +9,7 @@ export default Ember.Component.extend({ "tabindex", "ariaLabel:aria-label", "ariaHasPopup:aria-haspopup", - "title", + "sanitizedTitle:title", "value:data-value", "name:data-name", ], @@ -18,7 +18,7 @@ export default Ember.Component.extend({ ariaHasPopup: true, - ariaLabel: Ember.computed.or("computedContent.ariaLabel", "title"), + ariaLabel: Ember.computed.or("computedContent.ariaLabel", "sanitizedTitle"), @computed("computedContent.title", "name") title(computedContentTitle, name) { @@ -28,6 +28,13 @@ export default Ember.Component.extend({ return null; }, + // this might need a more advanced solution + // but atm it's the only case we have to handle + @computed("title") + sanitizedTitle(title) { + return String(title).replace("…", ""); + }, + label: Ember.computed.or("computedContent.label", "title", "name"), name: Ember.computed.alias("computedContent.name"),