Skip to content

Commit 5df995d

Browse files
authored
Merge pull request #18 from DogusErdem/fix/dropdown-onselect-prop
fix: multiple dropdown onselect prop return type updated
2 parents 62c9f3c + 338f442 commit 5df995d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/Dropdown/MultipleSelectDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const MultipleDropdown: FCCWD<DrowdownProps> = (
5656
} else {
5757
selectedObjectsTemp.push(value);
5858
}
59+
onSelect(selectedObjectsTemp);
5960
setSelectedObjects(selectedObjectsTemp);
6061
};
6162

@@ -147,7 +148,6 @@ const MultipleDropdown: FCCWD<DrowdownProps> = (
147148
onPress={() => {
148149
setSelectedObjects(item);
149150
toggleCheckBox(item);
150-
onSelect({ ...selectedObjects, item });
151151
}}
152152
style={[
153153
Style.row, {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export type DrowdownProps = {
145145
containerStyle?: StyleProp<ViewStyle>
146146
buttonTitle?: string,
147147
rowStyle?: StyleProp<ViewStyle>
148-
onSelect: (item: string | object) => void,
148+
onSelect: (item: Array<string> | Array<object> | object | string) => void,
149149
defaultValue?: Array<object | string>,
150150
rowTextStyle?: StyleProp<TextStyle>,
151151
buttonTextStyle?: StyleProp<TextStyle>,

0 commit comments

Comments
 (0)