question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Picker Not Consistently Firing onValueChange

See original GitHub issue

Issue Description

Since Picker uses RN’s Picker under the hood for Android, all issues from RN’s Picker is inherited by NativeBase Picker. This issue is only created for the record because I could not figure out this bug quickly, but there is indeed an related issue in RN’s repo.

Steps to Reproduce

The STR requires using redux state to keep track of selected values, specifically redux-form in my case:

render () {
  const {
      input: { value, onChange, ...inputProps },
  } = this.props
  return (
       <Picker
          selectedValue={value}
          onValueChange={onChange}
          {...inputProps}
        >
  );
}

Pick a value thats not the selected value, then repeat a few times.

Expected behaviour

onValueChange should be fired every single time the value is different from the previous. (EDITED) The value is selected and the picker shows the new value, however, some of the times onValueChange is not fired.

Actual behaviour

The value is selected and the picker shows the new value, however, some of the times onValueChange is not fired. (EDITED) onValueChange should be fired every single time the value is different from the previous.

Environment

  • React version: 16.0.0
  • NativeBase version: 2.3.6
  • React Native version: 0.50.3
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator / Android 6 / Debug

Is the bug present in both ios and android or in any one of them?

Android only.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
leoskyrockercommented, Jan 31, 2018

I mentioned that it’s not a direct issue here and I’ve referenced the issue in my original post. However, I opened an issue here because it is a problem from the perspective of native-base users.

However, you guys can handle this however you want:

  • close upon the issue is actually fixed to reflect the actual status;
  • or close right now as there’s no plan to actively fix this problem in native-base.

I’m fine either way as long as there’s a record here which could save people hours.

0reactions
toussacommented, Jan 30, 2018

Indeed, nothing to do with native-base: see react-native issue here, and its workaround for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Picker Not Consistently Firing onValueChange #15556
I expected onValueChange to fire if the Picker item selected is different from the current selection. Actual Behavior. About 33% of the time ......
Read more >
React Native Picker: onValueChange triggers unintended ...
(I tried this portion of code and it seems working just fine but I am not implementing your logic) import React from 'react';...
Read more >
Datepicker onChange/onSelect not working
Hi All I am trying to limit the range of dates that can be selected from the datepicker so I added some formulas...
Read more >
ion-datetime - Ionic Framework
Datetimes present a picker interface to select dates and times. ... Additionally, the hour is always in the 24-hour format, so 00 is...
Read more >
<input type="color"> - HTML: HyperText Markup Language
The value of an <input> element of type color is always a string ... The change event is fired when the user dismisses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found