@wistia/ui 0.5.4-beta.f71b82a7.da0eee9 → 0.5.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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.5.4-beta.f71b82a7.da0eee9
3
+ * @license @wistia/ui v0.5.4
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7789,6 +7789,9 @@ var StyledInputContainer = import_styled_components41.default.div`
7789
7789
  padding-right: 32px;
7790
7790
  }
7791
7791
  `;
7792
+ var isValidRef2 = (ref) => {
7793
+ return typeof ref === "object" && ref !== null && "current" in ref && (0, import_type_guards23.isNotNil)(ref.current);
7794
+ };
7792
7795
  var Input = (0, import_react21.forwardRef)(
7793
7796
  ({
7794
7797
  fullWidth = false,
@@ -7800,7 +7803,7 @@ var Input = (0, import_react21.forwardRef)(
7800
7803
  ...props
7801
7804
  }, externalRef) => {
7802
7805
  const internalRef = (0, import_react21.useRef)();
7803
- const ref = (0, import_type_guards23.isNotNil)(externalRef) && (0, import_type_guards23.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
7806
+ const ref = isValidRef2(externalRef) ? externalRef : internalRef;
7804
7807
  let leftIconToDisplay = leftIcon;
7805
7808
  if ((0, import_type_guards23.isNil)(leftIcon) && type === "search") {
7806
7809
  leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Icon, { type: "search" });
@@ -7822,7 +7825,7 @@ var Input = (0, import_react21.forwardRef)(
7822
7825
  if ((0, import_type_guards23.isNotNil)(props.onFocus)) {
7823
7826
  props.onFocus(event);
7824
7827
  }
7825
- if (autoSelect && isValidRef(ref) && "current" in ref) {
7828
+ if (autoSelect && ref && "current" in ref) {
7826
7829
  requestAnimationFrame(() => {
7827
7830
  ref.current?.select();
7828
7831
  });