Snackbar Duration Question
See original GitHub issueI assumed any number value could be passed to the duration prop. Is this not the case?
Current behaviour
Passing Infinity to the duration prop gives me an error:
Expected dynamic type ‘double’ but had type ‘null’. (constructing arguments for Timing.createTimer at argument index 1)
Expected behaviour
Assumed we could pass any value that is a number to the duration prop.
Code sample
<Snackbar
visible={this.props.isBLESnackbarVisible}
onDismiss={this.onDismiss}
duration={Infinity}
theme={theme}
action={{
label: 'SETTINGS',
onPress: () => {
AndroidOpenSettings.bluetoothSettings();
},
}}
>
Try resetting bluetooth.
</Snackbar>
What have you tried
I have passed in other number values with success (i.e. 15000, 30000, etc.)
Your Environment
software | version |
---|---|
ios or android | Android |
react-native | 0.57.8 |
react-native-paper | 2.7.0 |
node | 7.0.0 |
npm or yarn | 6.4.1 |
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Snackbar duration and height - flutter - Stack Overflow
The problem is that the snackbar appears for seconds and then disappears. So I have two questions: How to stop the snackbar from...
Read more >Snackbar duration | Thinkwise Community
Therefore it should be displayed short. And the message should be short. If the message is longer to read, it's duration should be...
Read more >Snackbar duration and height - Stack Overflow
I'm trying to show a snackbar. After I click on a gesture detector, this snack has two buttons. The problem is that the...
Read more >Snackbars - Material Design
Snackbars provide brief feedback about an operation through a message at the bottom of the screen.
Read more >Android Snackbar Example Tutorial - DigitalOcean
Snackbar.LENGH_LONG : This is last parameter which is the time limit how long snackbar to be displayed. show() method is used to display...
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 FreeTop 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
Top GitHub Comments
I would like to work on this issue!
@Taym95 awesome! PR welcome 😃