Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seedSelectedVals prop, that will allow the multiple select list … #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions components/MultipleSelectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ const MultipleSelectList: React.FC<MultipleSelectListProps> = ({
badgeTextStyles,
checkBoxStyles,
save = 'key',
dropdownShown = false
dropdownShown = false,
seedSelectedVals = []
}) => {

const oldOption = React.useRef(null)
const [_firstRender,_setFirstRender] = React.useState<boolean>(true);
const [dropdown, setDropdown] = React.useState<boolean>(dropdownShown);
const [selectedval, setSelectedVal] = React.useState<any>([]);
const [selectedval, setSelectedVal] = React.useState<any>(seedSelectedVals);
const [height,setHeight] = React.useState<number>(350)
const animatedvalue = React.useRef(new Animated.Value(0)).current;
const [filtereddata,setFilteredData] = React.useState(data);
Expand Down
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ export interface SelectListProps {


export interface MultipleSelectListProps {
/**
* the initial selected values of the multiple select list
*/
seedSelectedVals?: Array<{}>,

/**
* Fn to set Selected option value which will be stored in your local state
*/
Expand Down