ehscan-react-components 0.1.36 → 0.1.37

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.
Files changed (2) hide show
  1. package/dist/DropDown.js +9 -1
  2. package/package.json +1 -1
package/dist/DropDown.js CHANGED
@@ -35,7 +35,15 @@ export const DropDown = forwardRef(({ openDropDown, display, addItem, searchTerm
35
35
  if (e.key === "Enter" && tabId !== undefined) {
36
36
  console.log('use', display[tabId]);
37
37
  addItem(tabId);
38
- setTabId(0);
38
+ setTabId(prevTabId => {
39
+ if (prevTabId === undefined)
40
+ return 0;
41
+ if (display[prevTabId])
42
+ return prevTabId;
43
+ if (display[prevTabId - 1])
44
+ return prevTabId - 1;
45
+ return 0;
46
+ });
39
47
  }
40
48
  // Add other keys here if needed
41
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-components",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",