Skip to content

Commit

Permalink
fix: vertical tab prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Oct 9, 2024
1 parent 22cc7ad commit cf78eb8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export type SelectProps = Exclude<SelectButtonProps, 'children'> & {
type TriggerProps = {
buttonRef: RefObject<HTMLElement>
buttonElt: any
$isOpen: boolean
isOpen: boolean
} & HTMLAttributes<HTMLElement>

function Trigger({ buttonElt, $isOpen, ...props }: TriggerProps) {
function Trigger({ buttonElt, isOpen, ...props }: TriggerProps) {
const ref = props.buttonRef
const { buttonProps } = useButton(props, ref)
const theme = useTheme()
Expand All @@ -90,10 +90,10 @@ function Trigger({ buttonElt, $isOpen, ...props }: TriggerProps) {
ref,
...buttonProps,
...(buttonElt?.props?.type ? { type: buttonElt.props.type } : {}),
$isOpen,
isOpen,
style: {
appearance: 'unset',
...($isOpen ? { zIndex: theme.zIndexes.tooltip + 1 } : {}),
...(isOpen ? { zIndex: theme.zIndexes.tooltip + 1 } : {}),
},
tabIndex: 0,
})
Expand Down Expand Up @@ -374,7 +374,7 @@ function Select({
<Trigger
buttonRef={triggerRef as unknown as RefObject<HTMLElement>}
buttonElt={triggerButton}
$isOpen={state.isOpen}
isOpen={state.isOpen}
{...triggerProps}
/>
<PopoverListBox
Expand Down
4 changes: 2 additions & 2 deletions src/components/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const TabClone = styled(
ref: tabRef,
...props,
})
)<{ $vertical: boolean }>(({ theme, $vertical: vertical }) => ({
)<{ vertical: boolean }>(({ theme, vertical }) => ({
position: 'relative',
'&:focus, &:focus-visible': {
outline: 'none',
Expand Down Expand Up @@ -244,7 +244,7 @@ function TabRenderer({ item, state, stateProps, stateRef }: TabRendererProps) {
tabRef={ref}
{...props}
active={state.selectedKey === item.key}
$vertical={stateProps.orientation === 'vertical'}
vertical={stateProps.orientation === 'vertical'}
{...item.props}
>
{item.rendered}
Expand Down
14 changes: 5 additions & 9 deletions src/components/TagMultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ type TagMultiSelectProps = {
selectProps?: Omit<SelectPropsSingle, 'children'>
}

const MultiSelectMatchButtonContainer = styled.div`
> div {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right: none;
}
const MultiSelectMatchButtonContainer = styled(SelectButton)`
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right: none;
`

const TagMultiSelect = styled(TagMultiSelectUnstyled)(({ theme }) => ({
Expand Down Expand Up @@ -94,9 +92,7 @@ function TagMultiSelectUnstyled({
defaultOpen={false}
triggerButton={
<MultiSelectMatchButtonContainer>
<SelectButton>
{matchOptions.find((el) => el.value === searchLogic).label}
</SelectButton>
{matchOptions.find((el) => el.value === searchLogic).label}
</MultiSelectMatchButtonContainer>
}
{...selectProps}
Expand Down

0 comments on commit cf78eb8

Please sign in to comment.