@worldcoin/mini-apps-ui-kit-react 1.2.2 → 1.2.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.
@@ -21,7 +21,6 @@ const PhoneField = forwardRef(
21
21
  endAdornment,
22
22
  type = "tel",
23
23
  inputMode = "tel",
24
- autoComplete = "tel",
25
24
  autoCapitalize = "off",
26
25
  autoCorrect = "off",
27
26
  ...props
@@ -62,7 +61,6 @@ const PhoneField = forwardRef(
62
61
  ref: inputRef,
63
62
  type,
64
63
  inputMode,
65
- autoComplete,
66
64
  autoCapitalize,
67
65
  autoCorrect,
68
66
  value: inputValue,
@@ -22,6 +22,7 @@ const SearchField = forwardRef(
22
22
  const inputRef = useRef(null);
23
23
  const [isFocused, setIsFocused] = useState(false);
24
24
  const [isPasted, setIsPasted] = useState(false);
25
+ const [value, setValue] = useState("");
25
26
  useImperativeHandle(forwardedRef, () => inputRef.current);
26
27
  let endAdornment = endAdornmentProp;
27
28
  if (showPasteButton && !disabled && !isPasted) {
@@ -36,11 +37,12 @@ const SearchField = forwardRef(
36
37
  const event = createChangeEvent(inputRef.current);
37
38
  (_a = props.onChange) == null ? void 0 : _a.call(props, event);
38
39
  setIsPasted(true);
40
+ setValue(inputRef.current.value);
39
41
  }
40
42
  }
41
43
  }
42
44
  );
43
- } else if (isFocused && !disabled) {
45
+ } else if (isFocused && !disabled && value) {
44
46
  endAdornment = /* @__PURE__ */ jsx(
45
47
  ClearButton,
46
48
  {
@@ -50,6 +52,7 @@ const SearchField = forwardRef(
50
52
  if (inputRef.current) {
51
53
  const event = createChangeEvent(inputRef.current);
52
54
  (_a = props.onChange) == null ? void 0 : _a.call(props, event);
55
+ setValue("");
53
56
  }
54
57
  }
55
58
  }
@@ -78,6 +81,11 @@ const SearchField = forwardRef(
78
81
  setIsFocused(false);
79
82
  (_a = props.onBlur) == null ? void 0 : _a.call(props, e);
80
83
  },
84
+ onChange: (e) => {
85
+ var _a;
86
+ setValue(e.target.value);
87
+ (_a = props.onChange) == null ? void 0 : _a.call(props, e);
88
+ },
81
89
  className: "rounded-full h-[3.125rem]"
82
90
  }
83
91
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/mini-apps-ui-kit-react",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",