solid-ui 3.0.4-9a90250 → 3.0.4-aea68a1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/solid-ui.js CHANGED
@@ -4913,6 +4913,8 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
4913
4913
  field.style = inputStyle;
4914
4914
  rhs.appendChild(field);
4915
4915
  field.setAttribute('type', params.type ? params.type : 'text');
4916
+ var fieldType = (field.getAttribute('type') || '').toLowerCase();
4917
+ var deferWhileFocused = fieldType === 'date' || fieldType === 'datetime-local';
4916
4918
  var size = kb.anyJS(form, src_ns.ui('size')) || styleConstants.textInputSize || 20;
4917
4919
  field.setAttribute('size', size);
4918
4920
  var maxLength = kb.any(form, src_ns.ui('maxLength'));
@@ -4951,9 +4953,13 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
4951
4953
  }
4952
4954
  }, true);
4953
4955
  field.addEventListener('change', function (_e) {
4956
+ if (deferWhileFocused && dom.activeElement === field) return;
4954
4957
  // i.e. lose focus with changed data
4955
4958
  if (params.pattern && !field.value.match(params.pattern)) return;
4956
- field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker.
4959
+ var disabledForSave = !deferWhileFocused;
4960
+ if (disabledForSave) {
4961
+ field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker.
4962
+ }
4957
4963
  field.setAttribute('style', inputStyle + 'color: gray;'); // pending
4958
4964
  var ds = kb.statementsMatching(subject, property); // remove any multiple values
4959
4965
  var result;
@@ -5021,7 +5027,9 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
5021
5027
  updateMany(ds, is, function (uri, ok, body) {
5022
5028
  // kb.updater.update(ds, is, function (uri, ok, body) {
5023
5029
  if (ok) {
5024
- field.disabled = false;
5030
+ if (disabledForSave) {
5031
+ field.disabled = false;
5032
+ }
5025
5033
  field.setAttribute('style', inputStyle);
5026
5034
  } else {
5027
5035
  box.appendChild(errorMessageBlock(dom, body));