react-native-boxes 1.4.59 → 1.4.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Modal.tsx +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.59",
3
+ "version": "1.4.60",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Modal.tsx CHANGED
@@ -383,7 +383,7 @@ export type DropDownViewProps = {
383
383
  initialVisile?: Boolean,
384
384
  title?: string,
385
385
  displayType?: 'button' | 'input',
386
- onRenderList?: (opt: DropDownViewOption[]) => any,
386
+ onRenderList?: (opt: DropDownViewOption[], onSelect: (selectedId: string, opt: DropDownViewOption) => void) => any,
387
387
  onRenderOption?: (opt: DropDownViewOption, setSelected: (selectedId: string, opt: DropDownViewOption) => void) => any,
388
388
  onEmptyListPlaceholder?: (dismiss?: () => void) => React.ReactNode
389
389
  forceDialogSelectOnWeb?: Boolean
@@ -554,7 +554,10 @@ export const DropDownView = (props: DropDownViewProps) => {
554
554
  (
555
555
 
556
556
  props.onRenderList ?
557
- props.onRenderList(props.options) :
557
+ props.onRenderList(props.options, (selectedId: string, opt: DropDownViewOption) => {
558
+ setVisible(false)
559
+ props.onSelect(selectedId, opt)
560
+ }) :
558
561
  (
559
562
  props.options.map((opt, idx) => {
560
563
  if (props.onRenderOption) {