@brightspace-ui/core 2.107.0 → 2.107.1

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.
@@ -491,6 +491,13 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
491
491
  const tooltip = this.shadowRoot.querySelector('d2l-tooltip');
492
492
  tooltip.updatePosition();
493
493
  }
494
+ } else if (prop === 'type') {
495
+ const input = this.shadowRoot?.querySelector('.d2l-input');
496
+ setTimeout(() => {
497
+ if (input && this.value !== input.value) {
498
+ this._setValue(input.value, false);
499
+ }
500
+ }, 0);
494
501
  }
495
502
  });
496
503
  }
@@ -589,7 +596,7 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
589
596
  this.focus();
590
597
  }
591
598
 
592
- _setValue(val, updateInput) {
599
+ async _setValue(val, updateInput) {
593
600
 
594
601
  const oldVal = this.value;
595
602
  this._prevValue = (oldVal === undefined) ? '' : oldVal;
@@ -599,16 +606,17 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
599
606
  if (!input) return;
600
607
 
601
608
  this.setValidity({ tooShort: this.minlength && this.value.length > 0 && this.value.length < this.minlength });
602
- this.requestValidate(false);
603
609
  this.setFormValue(this.value);
604
610
 
605
611
  // Can't bind to input's value as Safari moves the cursor each time an
606
612
  // input's value gets set from render(). So we manually reach in
607
613
  // and update it when source of the change isn't the input itself.
608
614
  if (updateInput) {
615
+ await this.updateComplete;
609
616
  input.value = this.value;
610
617
  }
611
618
 
619
+ this.requestValidate(false);
612
620
  }
613
621
 
614
622
  _suppressEvent(e) {
@@ -136,7 +136,7 @@ export const _LocalizeMixinBase = dedupeMixin(superclass => class LocalizeMixinC
136
136
  const translatedMessage = new IntlMessageFormat(value, language);
137
137
  let formattedMessage = value;
138
138
  try {
139
- formattedMessage = translatedMessage.format({
139
+ const unvalidated = translatedMessage.format({
140
140
  b: chunks => localizeMarkup`<b>${chunks}</b>`,
141
141
  br: () => localizeMarkup`<br>`,
142
142
  em: chunks => localizeMarkup`<em>${chunks}</em>`,
@@ -145,7 +145,8 @@ export const _LocalizeMixinBase = dedupeMixin(superclass => class LocalizeMixinC
145
145
  strong: chunks => localizeMarkup`<strong>${chunks}</strong>`,
146
146
  ...params
147
147
  });
148
- validateMarkup(formattedMessage);
148
+ validateMarkup(unvalidated);
149
+ formattedMessage = unvalidated;
149
150
  } catch (e) {
150
151
  console.error(e);
151
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.107.0",
3
+ "version": "2.107.1",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",