@jobber/components-native 0.40.0 → 0.40.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.
@@ -11,6 +11,7 @@ export const InputText = forwardRef(InputTextInternal);
11
11
  function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText, keyboard, value: controlledValue, defaultValue, autoFocus, autoComplete = "off", spellCheck, textContentType = "none", validations, onChangeText, onSubmitEditing, onFocus, accessibilityLabel, accessibilityHint, autoCorrect, autoCapitalize, onBlur, multiline = false, prefix, suffix, transform = {}, clearable = multiline ? "never" : "while-editing", testID, secureTextEntry, styleOverride, }, ref) {
12
12
  var _a;
13
13
  const isAndroid = Platform.OS === "android";
14
+ const isIOS = Platform.OS === "ios";
14
15
  const { input: inputTransform = identity, output: outputTransform = identity, } = transform;
15
16
  const { error, field } = useFormController({
16
17
  name,
@@ -97,7 +98,13 @@ function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText
97
98
  field.ref(instance);
98
99
  } }))));
99
100
  function handleChangeText(value) {
100
- const newValue = outputTransform(value);
101
+ /**
102
+ * Replacing the U+FFFC character because it's duplicating text
103
+ * when dictating on iOS 16.
104
+ * https://github.com/facebook/react-native/issues/36521#issuecomment-1555421134
105
+ */
106
+ const removedIOSCharValue = isIOS ? value.replace(/\uFFFC/g, "") : value;
107
+ const newValue = outputTransform(removedIOSCharValue);
101
108
  setHasMiniLabel(Boolean(newValue));
102
109
  onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(newValue);
103
110
  field.onChange(newValue);