Only add the ellipses if the placeholder doesn't already end in one

(closes #3920)
This commit is contained in:
Bryan Housel
2017-03-21 22:11:35 -04:00
parent e9b8b743e7
commit c3502a4e16

View File

@@ -191,6 +191,7 @@ export function uiFieldCombo(field, context) {
function setPlaceholder(d) {
var ph;
if (isMulti || isSemi) {
ph = field.placeholder() || t('inspector.add');
} else {
@@ -199,8 +200,12 @@ export function uiFieldCombo(field, context) {
ph = field.placeholder() || placeholders.slice(0, 3).join(', ');
}
if (ph.match(/(…|\.\.\.)$/) === null) {
ph += '…';
}
container.selectAll('input')
.attr('placeholder', ph + '…');
.attr('placeholder', ph);
}