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.

iOS implementation does not respect value prop

See original GitHub issue

Simplified version: On iOS, the checkbox ALWAYS changes state when clicked/tapped, even when an explicit value is set. This is only the case in iOS; on Android, the checkbox respects the value prop even when it does not change after a click/tap.

To reproduce (iOS): <CheckBox disabled={ false } value={ true } onValueChange={(newValue) => console.log(newValue)} />

Now, try clicking/tapping the box. It will still become unchecked and “onValueChange” will still run" despite the value being explicitly set to true.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

2reactions
LogicAnalysiscommented, Jan 5, 2021

Any work around for this? This problem makes it basically not usable if one have any custom logic for the checkbox.

I ended up making a custom wrapper around this component with a state that basically sets a timer for 0ms after the click, and if the provided value hasn’t changed, it changes the state back to the value. If you’re interested, let me know and I can post the code for it when I have time later.

Seems a really cool work around, thanks for the help.

You’re welcome! Let me know if you have any issues implementing it, and I can post my code as I’d have to modify it a bit to take out some static values specific to my organization.

1reaction
pieterprovoostcommented, Jan 17, 2021

Can confirm that on Android the checkbox becomes unchecked as well, despite value being set to true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apple Value Proposition In A Nutshell - FourWeekMBA
Apple is a tech giant, and as such, it encompasses a set of value propositions that make Apple's brand recognized, among consumers.
Read more >
Aligning text and image on UIButton with imageEdgeInsets ...
I've been tweaking the values but going from say -5 to -10 on the left inset value doesn't appear to move it in...
Read more >
Unique Value Propositions and Their Necessity for Success
A powerful value proposition helps your target customers to see how what you offer benefit them, and is their only available option.
Read more >
Value Propositions – More than Marketing
“In the field of marketing a customer value proposition consists of the sum total of benefits which a vendor promises that a customer...
Read more >
8 Great Value Proposition Examples | Constant Contact
With the iOS update, customers can “connect,” “be present,” and “explore.” 2. Lyft. Lyft Value Proposition It's not just about riders — Lyft ......
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