Skip to content

Commit

Permalink
Merge branch 'fix-sui-react-dependencies' into new/navigation-design
Browse files Browse the repository at this point in the history
  • Loading branch information
creador-dev authored Oct 17, 2024
2 parents 86ad2d0 + 29065b6 commit 8c0ace7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@include modifier(hidden) {
.sui-#{$block}__body {
overflow: hidden;
padding: 1px; // To avoid children to appear cut
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions packages/ui/dropdown/src/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const Dropdown = forwardRef<DropdownRefProps | null, DropdownProps>(
arrow = true,
dropdownArrow = false,
buttonIcon,
buttonProps,
onMenuClick,
trigger,
renderContentOnTop = false,
Expand All @@ -63,7 +62,6 @@ const Dropdown = forwardRef<DropdownRefProps | null, DropdownProps>(
size = "md",
isDisabled = false,
closeOnOuterClick = true,
closeOnMenuItemClick = true,
colorScheme = "black",
onToggle = () => {},
// search
Expand Down Expand Up @@ -349,10 +347,6 @@ const Dropdown = forwardRef<DropdownRefProps | null, DropdownProps>(
if ("select-checkbox" !== type) {
setIsOpen(false)
}

if (closeOnMenuItemClick) {
setIsOpen(false)
}
}
}

Expand Down
8 changes: 0 additions & 8 deletions packages/ui/dropdown/src/dropdown.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ interface DropdownProps
* Filter button icon
*/
buttonIcon?: IconsNamesType
/**
* Filter button icon
*/
buttonProps?: ButtonProps
/**
* Filter button icon
*/
Expand Down Expand Up @@ -255,10 +251,6 @@ interface DropdownProps
* Close dropdown on outer click
*/
closeOnOuterClick?: boolean
/**
* Close dropdown on menu item click
*/
closeOnMenuItemClick?: boolean
/**
* Allow search
*/
Expand Down
11 changes: 7 additions & 4 deletions packages/ui/select/src/select-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, {
useState,
useEffect,
useRef,
HTMLProps,
ChangeEvent,
useId,
} from "react"
Expand All @@ -23,7 +22,6 @@ import { Selected, SelectedSearch } from "./elements/select-selected"
import {
SearchDropdown,
RemoveAll,
SelectAll,
RemoveSelection,
MultiSelectSearch,
} from "./utils/functions"
Expand Down Expand Up @@ -71,12 +69,17 @@ const Select: React.FC<SelectBaseProps> = ({
)
const [selectedItem, setSelectedItems] = useState<
Record<string, any> | string | undefined | SelectOptionType
>(selected)
>([])

const [customVar, setCustomVar] = useState<Array<string | SelectOptionType>>(
[],
)

// Update the selected items when the props change
useEffect(() => {
setSelectedItems(selected)
}, [selected])

const updateOptions = (itemsOpt: SelectOptionType[]) => {
setOptions(itemsOpt)
}
Expand All @@ -86,7 +89,7 @@ const Select: React.FC<SelectBaseProps> = ({
setFilteredItems(options ?? [])

// update selected item
setSelectedItems(options?.filter((option) => option.isSelected === true))
//setSelectedItems(options?.filter((option) => option.isSelected === true))
}, [options])

// Hide dropdown when click outside of it
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/table/src/table-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ const TableContextProvider: FC<TableContextProviderProps> = ({
break
}

console.log("tempSelected", tempSelected)

setSelected(tempSelected)
},
[rows, selected],
Expand Down

0 comments on commit 8c0ace7

Please sign in to comment.