FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

Close modal and update display field with custom button #47

Open BilalBudhani opened 8 years ago

BilalBudhani commented 8 years ago

Right button in Navigator has a very low visibility so I was thinking of adding a custom button in Modal view to close the modal and select the value. So far I'm able to close the modal but not able to update the display value of the field. Any suggestion?

        <GiftedForm.ModalWidget
          title='Recorded At'
          displayValue='recorded_at'
          scrollEnabled={false}>

          <GiftedForm.SeparatorWidget/>
          <GiftedForm.DatePickerIOSWidget
            name='recorded_at'
            mode='datetime'
            timeZoneOffsetInMinutes={this._getTimezoneOffset()}
            getDefaultDate={() => new Date() }
          />
          <Button
            onPress={() => this.props.navigator.pop()}
            style={{
              backgroundColor: '#3F5C7A',
              margin: 10,
            }}
            textStyle={{color: '#fff'}}>
            Done
          </Button>
        </GiftedForm.ModalWidget>
dev-vinoth commented 7 years ago

+1