Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Form/SingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function SingleSelect({
}))

const getInputLabel = () => {
if (!isFilter && !selectedOption) return placeholder || label || ''
if (!isFilter && !selectedOption) return ''
if (!selectedOption) return placeholder || label || ''

return selectedOption.label || selectedOption.value.toString()
Expand Down
5 changes: 3 additions & 2 deletions src/components/Tabs/TabGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ function TabGroup({
},
[orientation, variant, refContainer, dashRect]
)

const onClick = useCallback(
(event: MouseEvent<HTMLButtonElement>) => {
const nodes = Array.prototype.slice.call(refContainer.current?.children)
Expand Down Expand Up @@ -156,6 +155,7 @@ function TabGroup({
...child.props
})
}
if ((child as React.ReactElement)?.props?.hidden) return null
return child
})
}, [
Expand All @@ -172,8 +172,9 @@ function TabGroup({
])

useEffect(() => {
if ((children as React.ReactElement)?.props?.hidden) return
handleChangeIndicator(value)
}, [orientation, variant, wideLine, value])
}, [orientation, variant, wideLine, value, children])

return (
<div
Expand Down
22 changes: 12 additions & 10 deletions src/components/TopPage/TopPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,18 @@ const TopPage = ({
</Flex>
<div className="-mx-5 mt-1">
{tabs ? (
<TabGroup value={tabs.value} onChange={tabs.setValue}>
{tabs.items.map((tab, index) => (
<Tab
key={index}
label={tab.label}
disabled={tab.disabled}
hidden={tab.hidden}
toolTipProps={tab.toolTipProps}
/>
))}
<TabGroup value={tabs?.value} onChange={tabs?.setValue}>
{tabs?.items?.map((tab, index) => {
return (
<Tab
key={index}
label={tab.label}
disabled={tab.disabled}
hidden={tab.hidden}
toolTipProps={tab.toolTipProps}
/>
)
})}
</TabGroup>
) : (
<Divider className="mt-3" light />
Expand Down