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.

Disable onPress when button is loading

See original GitHub issue

Is your feature request related to a problem? Please Describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […] Normally, a loading = true means there is a pending state. A button on loading state shouldn’t pressable

Describe the solution you’d like A clear and concise description of what you want to happen. Button will check loading prop before call onPress. If loading = false, it will call onPress

Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
iRoachiecommented, Oct 20, 2019

Okay based on the discussion it seems that loading and disabled should be 2 separate states, and we shouldn’t have to combine disabled + loading together to show a loading state.

0reactions
iRoachiecommented, Oct 30, 2019

Merged! Thanks, everyone 💯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disabling buttons on react native - Stack Overflow
I use a text input component to accept text from the user and the button should only be enabled once the text input...
Read more >
Disable TouchableOpacity - Swair AQ - Medium
First import TouchableOpacity from react-native and don't do a mistake I did back in my time and let my app auto import it...
Read more >
How to disable a button in React | bobbyhadz
Use the `disabled` prop to disable a button in React, e.g. ` Click `. You can conditionally disable the button based on the...
Read more >
Disable Button in Flutter: The Simplest Way - FlutterBeads
Here's how to disable the ElevatedButton in Flutter: Step 1: Add the ElevatedButton to your page.
Read more >
React Button component - Material UI - MUI
The loading buttons can show loading state and disable interactions. ... Toggle the loading switch to see the transition between the different states....
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