react-native-boxes 1.4.35 → 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 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.35",
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,33 +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
- width: '100%',
418
- padding: theme.dimens.space.md,
419
- margin: theme.dimens.space.md
420
- }, props.style || {})}>
421
- {
422
- props.options.map(opt => {
423
- if (props.onRenderOption) {
424
- 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
+ })
425
448
  }
426
- return (
427
- <option
428
- style={{
429
- padding: theme.dimens.space.md,
430
- }}
431
- key={opt.id} id={opt.id} value={opt.id}>{opt.title || opt.value}</option>
432
- )
433
- })
434
- }
435
- </select>
449
+ </optgroup>
450
+ </select>
451
+ </>
436
452
  )
437
453
  }
438
454
  else {
@@ -578,6 +594,7 @@ export const DropDownView = (props: DropDownViewProps) => {
578
594
  }
579
595
 
580
596
 
597
+
581
598
  export type ConfirmationDialogProps = {
582
599
  visible: boolean,
583
600
  title?: string | React.Component,