FIX: prevents &hellip from being displayed in title attribute

This commit is contained in:
Joffrey JAFFEUX 2018-05-23 19:04:26 +02:00 committed by GitHub
parent 7232a6e5a9
commit a45d8a69f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -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"),