react-native-boxes 1.4.36 → 1.4.37

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 +42 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.36",
3
+ "version": "1.4.37",
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
@@ -406,32 +406,49 @@ export const DropDownView = (props: DropDownViewProps) => {
406
406
  const shouldShowLabel = props.listType == 'horizontal-list' ? !visible : true
407
407
  if (Platform.OS == 'web' && !props.forceDialogSelectOnWeb) {
408
408
  return (
409
- <select
410
- defaultValue={props.selectedId}
411
- onChange={(e) => {
409
+ <>
410
+ <select
411
+ value={props.selectedId}
412
+ defaultValue={props.selectedId}
413
+ onChange={(e) => {
414
+ //@ts-ignore
415
+ props.onSelect(e.target.value, props.options.find(o => o.id == e.target.value))
416
+ }}
412
417
  //@ts-ignore
413
- props.onSelect(e.target.value, props.options.find(o => o.id == e.target.value)?.value)
414
- }}
415
- //@ts-ignore
416
- style={Object.assign({
417
- padding: theme.dimens.space.md,
418
- margin: theme.dimens.space.md
419
- }, props.style || {})}>
420
- {
421
- props.options.map(opt => {
422
- if (props.onRenderOption) {
423
- return props.onRenderOption(opt, onSelect)
418
+ style={Object.assign({
419
+ color: theme.colors.text,
420
+ backgroundColor: theme.colors.background,
421
+ padding: theme.dimens.space.lg,
422
+ margin: theme.dimens.space.md,
423
+ paddingStart: theme.dimens.space.sm,
424
+ borderWidth: 1.5,
425
+ borderRadius: theme.dimens.space.sm,
426
+ borderColor: theme.colors.caption,
427
+ }, props.style || {})}>
428
+ <optgroup>
429
+
430
+ {
431
+ props.options.map(opt => {
432
+ if (props.onRenderOption) {
433
+ return props.onRenderOption(opt, onSelect)
434
+ }
435
+ return (
436
+ <option
437
+ style={{
438
+ fontFamily: theme.fonts.Regular,
439
+ backgroundColor: theme.colors.background,
440
+ color: theme.colors.text,
441
+ padding: theme.dimens.space.md,
442
+ paddingTop: theme.dimens.space.lg,
443
+ paddingBottom: theme.dimens.space.lg,
444
+ }}
445
+ key={opt.id} id={opt.id} value={opt.id}>{opt.title || opt.value}</option>
446
+ )
447
+ })
424
448
  }
425
- return (
426
- <option
427
- style={{
428
- padding: theme.dimens.space.md,
429
- }}
430
- key={opt.id} id={opt.id} value={opt.id}>{opt.title || opt.value}</option>
431
- )
432
- })
433
- }
434
- </select>
449
+ </optgroup>
450
+ </select>
451
+ </>
435
452
  )
436
453
  }
437
454
  else {
@@ -577,6 +594,7 @@ export const DropDownView = (props: DropDownViewProps) => {
577
594
  }
578
595
 
579
596
 
597
+
580
598
  export type ConfirmationDialogProps = {
581
599
  visible: boolean,
582
600
  title?: string | React.Component,