Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActivityIndicatorIOS doesn't hide initially in 0.27 #7987

Closed
Purii opened this issue Jun 7, 2016 · 3 comments
Closed

ActivityIndicatorIOS doesn't hide initially in 0.27 #7987

Purii opened this issue Jun 7, 2016 · 3 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@Purii
Copy link
Contributor

Purii commented Jun 7, 2016

There seems to be a bug with ActivityIndicatorIOS in the latest stable release.

  1. Set animating={false} dynamically works as expected (ActivityIndicatorIOS is hidden)
  2. Set animation={false} as initial prop won't hide it.

Reproduce

I assume that HMR is enabled for steps 3-5. Otherwise just use the template below.

  1. Fresh project: react-native init helloWorld
  2. Add <ActivityIndicatorIOS animating={false} /> to index.ios.js
  3. Run the simulator, e.g. via react-native run-ios --> Is shown and not animated
  4. Change prop to <ActivityIndicatorIOS animating={true} /> --> Is shown and animated
  5. Change prop back to <ActivityIndicatorIOS animating={false} /> --> Is hidden as it should

Template

...
import {
  AppRegistry,
  ActivityIndicatorIOS,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
} from 'react-native';
...
class helloWorld extends Component {
  constructor(props) {
    super(props);
    this.state = {
      animateActivityIndicatorIOS: false,
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity onPress={() => this.setState({animateActivityIndicatorIOS: !this.state.animateActivityIndicatorIOS})}>
          <Text>Toggle ActivityIndicatorIOS</Text>
        </TouchableOpacity>
        <Text>{'\n'}This ActivityIndicatorIOS should be shown initially, although animating=false:{'\n'}</Text>
        <ActivityIndicatorIOS animating={this.state.animateActivityIndicatorIOS} />
      </View>
    );
  }
}
@charpeni
Copy link
Contributor

charpeni commented Jun 7, 2016

cc @janicduplessis

Seems related to #7976.

@ide ide mentioned this issue Jun 8, 2016
4 tasks
@janicduplessis janicduplessis added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Platform: iOS iOS applications. Help Wanted :octocat: Issues ideal for external contributors. labels Jun 13, 2016
@janicduplessis
Copy link
Contributor

It seems like calling UIActivityIndicator.stopAnimating doesn't work before the view has been layed out. I had a similar issue with RefreshControl and what I ended up doing is calling it in the first call you layoutSubviews. If someone wants to submit a PR to fix this it would be great as I'm pretty busy at the moment :)

ghost pushed a commit that referenced this issue Jun 28, 2016
Summary:
I used the reproducible steps as described in origin bug ticket #7987 as test plan.
This has the same contents as PR #8130 but then against master per janicduplessis request.
Closes #8134

Differential Revision: D3491126

fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee
ide pushed a commit that referenced this issue Jul 2, 2016
Summary:
I used the reproducible steps as described in origin bug ticket #7987 as test plan.
This has the same contents as PR #8130 but then against master per janicduplessis request.
Closes #8134

Differential Revision: D3491126

fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee
@timjacobi
Copy link
Member

Can this be closed?

@Purii Purii closed this as completed Jul 15, 2016
samerce pushed a commit to iodine/react-native that referenced this issue Aug 23, 2016
Summary:
I used the reproducible steps as described in origin bug ticket facebook#7987 as test plan.
This has the same contents as PR facebook#8130 but then against master per janicduplessis request.
Closes facebook#8134

Differential Revision: D3491126

fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee
mpretty-cyro pushed a commit to HomePass/react-native that referenced this issue Aug 25, 2016
Summary:
I used the reproducible steps as described in origin bug ticket facebook#7987 as test plan.
This has the same contents as PR facebook#8130 but then against master per janicduplessis request.
Closes facebook#8134

Differential Revision: D3491126

fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee
@facebook facebook locked as resolved and limited conversation to collaborators Jul 15, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants