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

Social Signup: Handle the case where users block third-party cookies/data #13983

Merged
merged 14 commits into from
May 29, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Always associate the Popover with the social button
  • Loading branch information
pento authored and drewblaisdell committed May 24, 2017
commit 46d8aa6248edb89e3e590f8d25f43414df4daac2
5 changes: 3 additions & 2 deletions client/components/social-buttons/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import React, { Component, PropTypes } from 'react';
import { loadScript } from 'lib/load-script';
import { localize } from 'i18n-calypso';
import closest from 'component-closest';

/**
* Internal dependencies
Expand Down Expand Up @@ -92,7 +93,7 @@ class GoogleLoginButton extends Component {
if ( this.state.error ) {
this.setState( {
showError: ! this.state.showError,
errorRef: event.target,
errorRef: closest( event.target, '.social-buttons__button', true ),
Copy link
Member

@gziolo gziolo May 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pento I think https://developer.mozilla.org/en/docs/Web/API/Event/currentTarget, event.currentTarget will do the trick :)

It always refers to the element to which the event handler has been attached, as opposed to event.target which identifies the element on which the event occurred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, cool. That's my new thing learned for today, and it's only 10AM! :-)

} );

return;
Expand All @@ -114,7 +115,7 @@ class GoogleLoginButton extends Component {

this.setState( {
showError: true,
errorRef: event.target,
errorRef: closest( event.target, '.social-buttons__button', true ),
} );
}

Expand Down