Skip to content

Share Method Multiple Dialogs #18153

Closed
Closed
@sfm2222

Description

@sfm2222

I’m using react native share, to share text content. The issue is multiple share dialog are opened over each other on clicking share button multiple times. Even I have disabled button on share click but it is of no use as well.

Expected Behavior

The standard way is if share dialoge is already open, on clicking the share button again the window get closed. How can it be done?

Actual Behavior

Opening multiple share dialogs.

Environment

	"react-native": "0.50.3",

Steps to Reproduce


<Button 
 transparent
 disabled={this.state.isShareDisabled}
  onPress={() => that.onShare(index)}>

onShare() {
    if(!this.state.isShareDisabled)
    {
    this.setState(
        {
            isShareDisabled:true
        }
    )
    Share.share({
      message: “Message test”,
      url: ”www.google.com”,
      title: “Title test”
    }, {
      // Android only:
      dialogTitle: 'Share',
      // iOS only:
      excludedActivityTypes: [
        'com.apple.UIKit.activity.PostToTwitter'
      ]
    }) .then((result) => {
        this.setState(
            {
                isShareDisabled: false,
            }
        )
    })
}
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions