doomsower / react-native-modal-popover

React-Native pure JS popover that uses Modal
MIT License
322 stars 45 forks source link

Popover not shown when wrapping Switch #21

Closed paynd closed 6 years ago

paynd commented 6 years ago

Popover not shown on tap when wrapping Switch. If I change Switch to Text it works fine.

<View style={style}>
        <PopoverTouchable>
            <Switch
              onValueChange={onValueChange}
              value={state}
            />
          <Popover
            placement="top"
            contentStyle={styles.popoverContent}
            arrowStyle={styles.popoverArrow}
            backgroundStyle={styles.popoverBackground}>
            <Tooltip style={styles.tooltip} title={title} state={state} description={description} />
          </Popover>
        </PopoverTouchable>
 </View>
doomsower commented 6 years ago

PopoverTouchable works only with components that have onPress property - Touchables and Text. If you want to use Popover with Switch you have to control Popover manually. You can PopoverTouchable implementation as a starting point.