@descope/web-components-ui 3.16.2 → 3.16.4

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/index.esm.js CHANGED
@@ -19179,8 +19179,17 @@ class RawHybridField extends BaseClass$8 {
19179
19179
 
19180
19180
  setActiveInputSelectionStart() {
19181
19181
  setTimeout(() => {
19182
- this.activeInputEle.focus();
19183
- this.activeInputEle.setSelectionRange?.(this.#selectionStart, this.#selectionStart);
19182
+ const ele = this.activeInputEle;
19183
+ ele.focus();
19184
+ // setSelectionRange throws InvalidStateError on input types that do not
19185
+ // support selection (e.g. `email`). The focus handler usually switches
19186
+ // type to `text` first, but that can race with the blur timer or fail
19187
+ // to fire (e.g. background tab). Restoring the caret is best-effort.
19188
+ try {
19189
+ ele.setSelectionRange?.(this.#selectionStart, this.#selectionStart);
19190
+ } catch {
19191
+ /* noop */
19192
+ }
19184
19193
  });
19185
19194
  }
19186
19195