@thecb/components 10.7.6-beta.0 → 10.7.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.7.6-beta.0",
3
+ "version": "10.7.6",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -120,6 +120,7 @@ const FormInput = ({
120
120
  ...props
121
121
  }) => {
122
122
  const [showPassword, setShowPassword] = useState(false);
123
+ const [isFocused, setIsFocused] = useState(false);
123
124
  const { isMobile } = useContext(ThemeContext);
124
125
 
125
126
  const setValue = value => {
@@ -134,6 +135,7 @@ const FormInput = ({
134
135
  if (isRequired && value === "") {
135
136
  setValue("");
136
137
  }
138
+ setIsFocused(false);
137
139
  };
138
140
 
139
141
  return (
@@ -226,6 +228,15 @@ const FormInput = ({
226
228
  data-qa={dataQa || labelTextWhenNoError}
227
229
  autoComplete={autocompleteValue}
228
230
  required={isRequired}
231
+ // Additional handler to detect autofilled values
232
+ {...(autocompleteValue && {
233
+ onFocus: e => {
234
+ if (!isFocused) {
235
+ setValue(e.target?.value);
236
+ setIsFocused(true);
237
+ }
238
+ }
239
+ })}
229
240
  {...props}
230
241
  />
231
242
  ) : (
@@ -134,6 +134,7 @@ const PaymentFormCard = ({
134
134
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
135
135
  isNum
136
136
  autocompleteValue="cc-number"
137
+ name="cc-number"
137
138
  isRequired={true}
138
139
  />
139
140
  <FormInputRow
Binary file