diff --git a/package.json b/package.json index 79c4994..b82d171 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "craftbook", "private": false, - "version": "1.5.2", + "version": "1.5.3", "author": "Yash Sehgal ", "type": "module", "files": [ diff --git a/src/components/tab-menu/tab-menu.tsx b/src/components/tab-menu/tab-menu.tsx index 8662d58..4f4ab35 100644 --- a/src/components/tab-menu/tab-menu.tsx +++ b/src/components/tab-menu/tab-menu.tsx @@ -6,6 +6,7 @@ interface TabMenuProps extends React.HTMLAttributes { options: string[]; currentOption: string; stretch?: boolean; + updateSelection: (option: string) => void; } interface TabMenuOptionProps @@ -17,7 +18,14 @@ interface TabMenuOptionProps const TabMenu = forwardRef( ( - { className, options, currentOption = '', stretch = false, ...props }, + { + className, + options, + currentOption = '', + stretch = false, + updateSelection, + ...props + }, ref, ) => { const [selectedOption, setSelectedOption] = useState( @@ -45,6 +53,7 @@ const TabMenu = forwardRef( key={index} onClick={() => { setSelectedOption(option); + updateSelection(option); }} isSelected={option === selectedOption} />