[FORCEFULLY SOLVED] The button keeps focused => hovered after pressing it | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[FORCEFULLY SOLVED] The button keeps focused => hovered after pressing it

After the button is pressed, I want it to stay in its original style, but it keeps focused, so I did button.blur() Now, it keeps being hovered, fix it? https://code.sololearn.com/W732w0i25kCF/?ref=app

5th Dec 2020, 7:29 AM
Bibek Oli
Bibek Oli - avatar
9 Answers
+ 5
March Zucherberg You're calling the function immediately and then calling undefined in a second! Don't call it immediately, pass in a function.. then it will work
5th Dec 2020, 8:19 AM
Piyush
Piyush - avatar
+ 4
March Zucherberg pass this inside of setTimeout: () => button.blur() instead of just button.blur()
5th Dec 2020, 10:13 AM
maf
maf - avatar
+ 3
Hi.. Focus cannot be done on an hidden object if I am right. The focus works the same way a user interacts. Which means, if user cannot focus then the js cannot too
7th Dec 2020, 6:34 AM
Steve Sajeev
Steve Sajeev - avatar
+ 1
how can this be
6th Dec 2020, 4:26 PM
Bekzhanov Namazbek
Bekzhanov Namazbek - avatar
0
😂😂 I am also his bigger fan😉
5th Dec 2020, 8:15 AM
Bibek Oli
Bibek Oli - avatar
0
maf did that, but the button still stays hovered. Edit: I thought an idea that only one element can be focused at a time and created a hidden button and clicked that button using Javascript. the hidden button is focused and clicked, but still that stupid button shows focused😂
5th Dec 2020, 10:54 AM
Bibek Oli
Bibek Oli - avatar
0
Ram
5th Dec 2020, 12:58 PM
Lathamaheshwari Lathamaheshwari
Lathamaheshwari Lathamaheshwari - avatar
0
Piyush[21 Dec❤️] I don't understand, can you give example.
5th Dec 2020, 1:49 PM
Bibek Oli
Bibek Oli - avatar
- 2
March Zucherberg 😑 Why you puted mark zuckerberg name and photo on your profile. I am one of big fan of him
5th Dec 2020, 7:49 AM
🇧🇩 𝚂𝚊𝚋𝚋𝚒𝚛 𝙷𝚘𝚜𝚜𝚊𝚒𝚗 🇧🇩
🇧🇩 𝚂𝚊𝚋𝚋𝚒𝚛 𝙷𝚘𝚜𝚜𝚊𝚒𝚗 🇧🇩 - avatar