gbs-add-block 0.0.42 → 0.0.43

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GBS Building Blocks 2.0 (v0.0.42)
1
+ # GBS Building Blocks 2.0 (v0.0.43)
2
2
 
3
3
  Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
4
4
 
@@ -6,7 +6,7 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
6
6
 
7
7
  For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
8
8
 
9
- ## What's New 🎉 (Ver 0.0.42)
9
+ ## What's New 🎉 (Ver 0.0.43)
10
10
 
11
11
  - Refactored Code for Better Readability and removed dependency for Toast
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gbs-add-block",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "React Component Library",
5
5
  "files": [
6
6
  "index.js",
@@ -92,7 +92,7 @@ export default function SelectHandles({
92
92
  }
93
93
  }, [item?.name, dependencyMap, formRef]);
94
94
 
95
- const handleSelect = (value: string, key: string) => {
95
+ const handleSelect = (value: string | undefined, key: string) => {
96
96
  if (!formRef?.current) return;
97
97
 
98
98
  let input = formRef.current.querySelector(
@@ -106,7 +106,9 @@ export default function SelectHandles({
106
106
  formRef.current.appendChild(input);
107
107
  }
108
108
 
109
- input.value = value;
109
+ if (value) {
110
+ input.value = value;
111
+ }
110
112
  const event = new Event("change", { bubbles: true });
111
113
  input.dispatchEvent(event);
112
114
  };
@@ -123,7 +125,7 @@ export default function SelectHandles({
123
125
  name={item?.name}
124
126
  items={options}
125
127
  selectedItem={item?.value ?? ""}
126
- onSelect={(value: string) => {
128
+ onSelect={(value: string | undefined) => {
127
129
  item?.name && handleSelect(value, item.name);
128
130
  setRequirementError &&
129
131
  setRequirementError((prevErrors) =>
@@ -182,6 +182,11 @@ export const FileUploader = ({
182
182
  return rest;
183
183
  });
184
184
 
185
+ // Reset file input to allow re-selecting the same file
186
+ if (fileInputRef.current) {
187
+ fileInputRef.current.value = "";
188
+ }
189
+
185
190
  if (onChange) onChange(updatedFiles);
186
191
  };
187
192