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

BUG: double click at the end of memory game unvails second card automaticaly #6

Open
DieKant opened this issue Jan 18, 2022 · 3 comments

Comments

@DieKant
Copy link

DieKant commented Jan 18, 2022

Hi, after finishing the lesson about this project I've noticed that if i make a fast double click on one card's cover the second card flips by itself without me touching it, is it normal behaviour?

(IF I find a solution I'll submit a pull request with the fix)

@aaryak12
Copy link

if (choiceOne.src === choiceTwo.src && choiceOne.id !== choiceTwo.id) // App.js

This should do the trick

@Amandeepammy
Copy link

@aaryak12
I caught in the same problem that @DieKant mentioned. and used your solution. Your solution flip the card back and made another move in the count.
Try this:
if(choiceOne && choiceTwo && choiceOne !== choiceTwo)

@aagatsharma
Copy link

This worked for me:
if(choiceOne.src && choiceTwo.src && choiceOne !== choiceTwo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants