From: Coleman Watts Date: Sun, 22 Sep 2019 18:31:07 +0000 (-0400) Subject: Fix number fields in api explorer X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6872a653747a946c07ee65af7507d5495d97d20d;p=civicrm-core.git Fix number fields in api explorer Only use html5 number input when dealing with single valued input --- diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index c7e08dd960..76cd99d942 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -641,7 +641,7 @@ require: 'ngModel', link: function (scope, element, attrs, ctrl) { var ts = scope.ts = CRM.ts('api4'), - multi = _.includes(['IN', 'NOT IN'], scope.data.op), + multi = _.includes(['IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'], scope.data.op), entity = $routeParams.api4entity, action = $routeParams.api4action; @@ -663,7 +663,7 @@ if (!op) { op = field.serialize || dataType === 'Array' ? 'IN' : '='; } - multi = _.includes(['IN', 'NOT IN'], op); + multi = _.includes(['IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'], op); if (op === 'IS NULL' || op === 'IS NOT NULL') { $el.hide(); return; @@ -690,7 +690,7 @@ {id: '0', text: ts('No')} ]}); } - } else if (dataType === 'Integer') { + } else if (dataType === 'Integer' && !multi) { $el.attr('type', 'number'); } }