From 46beb31e740618a329c09c52fae7d0d85e4b76bd Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Fri, 18 Jan 2019 11:59:40 -0500 Subject: [PATCH] Removed extra padding in comboboxes when the caret is hidden --- css/80_app.css | 9 +++++++++ modules/ui/fields/combo.js | 10 ++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index f662e2b3b..91d6ba38f 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -1420,6 +1420,15 @@ img.tag-reference-wiki-image { .form-field-input-combo > input:only-of-type { border-radius: 0 0 4px 4px; } +.form-field-input-combo.empty-combobox input, +.form-field-input-multicombo .empty-combobox input { + padding-right: 10px; + padding-left: 10px; +} +.form-field-input-combo.empty-combobox .combobox-caret, +.form-field-input-multicombo .empty-combobox .combobox-caret { + display: none; +} .form-field-input-multicombo ul.chiplist { padding: 5px 7px 5px 7px; diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 5b7956d29..d6bc6d043 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -191,14 +191,8 @@ export function uiFieldCombo(field, context) { }); } - if (data.length === 0) { - // hide the caret if there are no suggestions - container.select('.combobox-caret') - .style('display', 'none'); - } else { - container.select('.combobox-caret') - .style('display', null); - } + // hide the caret if there are no suggestions + container.classed('empty-combobox', data.length === 0); _comboData = _map(data, function(d) { var k = d.value;