react-frontend-common-components 0.1.3 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frontend-common-components",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Reusable frontend library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -91,18 +91,15 @@ const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
91
91
  }
92
92
 
93
93
  if (name === "name") {
94
- newValue = newValue.replace(/[^a-zA-Z\s]/g, "");
94
+ const alphabetOnly = /^[a-zA-Z\s]*$/;
95
+ if (!alphabetOnly.test(newValue)) return;
95
96
  }
96
97
 
97
98
  setInputValue(newValue);
98
99
  setIsTyping(newValue.length > 0);
99
- handleChange?.({
100
- ...e,
101
- target: { ...e.target, value: newValue },
102
- });
100
+ handleChange?.(e);
103
101
  };
104
102
 
105
-
106
103
  return (
107
104
  <div className={`appInput ${className || ""}`}>
108
105
  {required && !isTyping && !inputValue && (