Disable onPress when button is loading
See original GitHub issueIs 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:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
Merged! Thanks, everyone 💯