-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. #5974
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5974 +/- ##
===========================================
- Coverage 45.3% 45.27% -0.03%
===========================================
Files 520 521 +1
Lines 30667 30688 +21
Branches 4597 4597
===========================================
+ Hits 13893 13894 +1
- Misses 16774 16794 +20
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @geetchoudhary Thanks for the PR.
Did you test this locally? It's not working as expected. I went to the All Categories
part and pressed tab on the last item, it moved to the next element but didn't closed the current drop down.
@bansalnitish yes, I just checked it again and it was working fine for me, are all the other things working as expected? |
Sir, I am also attaching a video link in which I am testing the same. |
Yes you're right @geetchoudhary, the working of these looks okay but did you check the working of |
@bansalnitish , There was nothing specified about the working of about tab in the issue #4936. Neither I have made any changes to it. |
Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried and played with tab and shift-tab buttons on these two menus and the following are my observations:
-
Click on the
All Categories
button and then press tabs and go to the end and press tab. You'll notice this tab won't close. -
Enter the
All Categories
menu by pressing entering after adjusting focus over it. You could do this by pressing tab once or twice right at the start. Focus will come toAll Categories
and then press tabs, reach the last element and then it will work fine. So if we enter by clicking the menu button it is not working fine. -
This is minor but I noticed like in Profiles and the About tab if you press a tab focus goes to the first item of the menu whereas in
All Categories
andLanguage
pressing the tab twice is required to shift the focus.
@geetchoudhary you could work on the first one as that is more important we can check for the third one later. Also, let me know if you too can reproduce the above three points, thanks!
@bansalnitish I have fixed the major issue. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks as if you pasted the stuff from the mentioned PR. You declared some functions but you haven't used them. Could you please correctly use these functions by referring to the above PR?
In general, it's good to refer to previous work but blind copying is not a good idea. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment for you. PTAL!
@bansalnitish Please check the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @geetchoudhary, LGTM!
@nithusha21 could you take a pass here ?
I'll defer to @DubeySandeep :) |
@geetchoudhary any updates on this one ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @DubeySandeep, lets not repeat the code and instead have a service for the same.
(To avoid merge)
@bansalnitish I tried working on it but could not get it to work. I am trying today also, will push the changes as soon as it is done. |
HI @geetchoudhary, |
Hi @bansalnitish , I created a Service (NavigationService) The service is working fine with SearchBarDirective.js with the following code But the same service is not working with TopNavigationBarDirective.js Can you please help me out? |
Hi @geetchoudhary, It's a bit hard to review the code through screenshots. Can you please push these changes? |
@bansalnitish PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @geetchoudhary, thanks for pushing the changes.
I think the comment below will resolve the issue. Also, could you please upload a clean code (without unnecessary comments) after which I'll take my next pass.
core/templates/dev/head/components/top_navigation_bar/TopNavigationBarDirective.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @geetchoudhary, This is looking much better now, I have one more comment for you.
Hi @geetchoudhary. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks! |
@bansalnitish . PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @geetchoudhary, this is really close now. Just one minor nit!
dc69a83
to
3fdf0e9
Compare
Why do you need to merge develop into this PR again ? (Just a comment was needed to be addressed) Also, for what did you use force-push? |
@bansalnitish , because of the merge conflict in TopNavigationBar.js |
You resolved the merge conflicts above, right ? |
Yes, everything is okay now. |
Still I don't think we really need to force-push. You could follow point 3 here - https://github.com/oppia/oppia/wiki/Git-cheat-sheet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @geetchoudhary, good job :)
LGTM!
@bansalnitish , Kindly merge. |
Explanation
Fixes #4936
The dropdown menus are now working similar to what the about and profile dropdown behaves with the keyboard. I.e on pressing
tab on the last element, the dropdown closes and the focus is passed on to the next element.
shift + tab on the first element, the dropdown closes and the focus is passed on to the previous element.
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.