Skip to content

Commit bc81748

Browse files
committed
Prevent form submission.
1 parent ce087eb commit bc81748

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

popup-app/components/IdpSelect.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export default class IdpSelect extends React.Component {
2424
this.setState({ idp })
2525
}
2626

27-
handleSelectIdp = async idp => {
27+
handleSelectIdp = idp => async event => {
28+
event.preventDefault()
2829
this.setState({ idp })
2930
if (!window.opener) {
3031
console.warn('No parent window')
@@ -68,7 +69,7 @@ export default class IdpSelect extends React.Component {
6869
</h1>
6970
{error && <p className="error">{error}</p>}
7071
<p>Please enter your WebID or the URL of your identity provider:</p>
71-
<form className="custom-idp" onSubmit={() => this.handleSelectIdp(idp)}>
72+
<form className="custom-idp" onSubmit={this.handleSelectIdp(idp)}>
7273
<input
7374
ref={input => (this.idpInput = input)}
7475
type="url"
@@ -86,7 +87,7 @@ export default class IdpSelect extends React.Component {
8687
{idps.map(idp => (
8788
<button
8889
className="idp"
89-
onClick={() => this.handleSelectIdp(idp.url)}
90+
onClick={this.handleSelectIdp(idp.url)}
9091
key={idp.url}
9192
>
9293
{idp.displayName}

0 commit comments

Comments
 (0)