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.

When I click on an option, the popup menu goes away but nothing happens.

See original GitHub issue

The setup is as follows:

'use strict';

import React, { Component, PropTypes } from 'react';
import { View, TextInput, Image, Platform } from 'react-native';
import ImagePicker from 'react-native-image-picker';

import styles from '../lib/styles';
import constants from '../lib/constants';
const {
  AMAZON_AWS_URL,
} = constants;

class UserProfilePage extends Component {
  constructor(props) {
    super(props);
    this.startImagePicker = this.startImagePicker.bind(this);
  }
  startImagePicker() {
    // More info on all the options is below in the README...just some common use cases shown here
    const options = {
      title: null,
      storageOptions: {
        skipBackup: true,
        path: 'images'
      }
    };
    /**
     * The first arg is the options object for customization (it can also be null or omitted for default options),
     * The second arg is the callback which sends object: response (more info below in README)
     */
    ImagePicker.showImagePicker(options, (response) => {
      console.log('Response = ', response);

      if (response.didCancel) {
        console.log('User cancelled image picker');
      }
      else if (response.error) {
        console.log('ImagePicker Error: ', response.error);
      }
      else {
        // You can display the image using either data...
        const source = {uri: 'data:image/jpeg;base64,' + response.data, isStatic: true};

        // or a reference to the platform specific asset location
        if (Platform.OS === 'ios') {
          const source = {uri: response.uri.replace('file://', ''), isStatic: true};
        } else {
          const source = {uri: response.uri, isStatic: true};
        }
        this.setState({
          avatarSource: source
        });
      }
    });
  }
  render() {
    return(
      <View style={styles.container}>
          <View style={styles.profileImageContainer2}>
            <Image style={styles.profileImage2} source={{uri: AMAZON_AWS_URL + this.props.user.photo}} />
          </View>
          <Button style={styles.uploadButton} textStyle={styles.white} onPress={this.startImagePicker}>Upload</Button>
      </View>
    );
  }
}

and here are my dependencies:

"react": "15.2.1",
"react-native": "0.28.0",
"react-native-image-picker": "^0.21.2",

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AaronLlanoscommented, Jul 25, 2016

Okay,

first off: thanks for all of the quick responses.

Second: I went through the manual android installation and the only thing that rnpm link didn’t do was add any of the permissions to the androidmanifest.xml file. After adding those permissions everything worked appropriately without even adding the onActivityResult functions to my MainActivity.java files. Tested on Android 6.0.1 on debug mode with react-native run-android

Third: I tested on iOS to see if there were similar errors but it ran perfectly with no edits.

With that being said, I think that there should be a bug ticket for rnpm link to add the proper permissions? Other than that, it works great! Thanks for all of the help, fellas!

Best, Aaron

0reactions
marcshillingcommented, Jul 28, 2016

Glad you got it working! I’m not sure if permissions falls to the responsibility of rnpm, but it might be worth starting the discussion over on that repo…cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with popups and drop down menus on Windows 10
I have been having issues with drop down menus and pop ups. They disappear before being able to select an option.
Read more >
Mac Air M1 dropdown menu not responding. - Apple Community
applications work fine, but you can't use the dropdown menus. Running one external monitor. The problem goes away with a restart.
Read more >
Windows 10 Start Menu Not Opening: 7 Things to Try
The Windows 10 Shut down menu will appear and you can choose to either Sign out or do a full Restart.
Read more >
Menu select item stuck on screen after context or command ...
Go to Start -> Run -> and type tskill dwm . This command will reset the desktop window manager without the need to...
Read more >
Right Click Context Menu Not Disappearing - YouTube
Right Click Context Menu Not Disappearing - Box Remaining On Screen In Windows 10/8/7 FIX. This error which causes the context menu (or...
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