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

Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. #5974

Merged
merged 16 commits into from
Dec 28, 2018

Conversation

geetchoudhary
Copy link
Contributor

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

  1. tab on the last element, the dropdown closes and the focus is passed on to the next element.

  2. shift + tab on the first element, the dropdown closes and the focus is passed on to the previous element.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR follows the style guide.
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue.

@codecov-io
Copy link

codecov-io commented Dec 12, 2018

Codecov Report

Merging #5974 into develop will decrease coverage by 0.02%.
The diff coverage is 2.56%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
...lates/dev/head/pages/library/SearchBarDirective.js 1.02% <0%> (-0.1%) ⬇️
...ts/top_navigation_bar/TopNavigationBarDirective.js 0.88% <0%> (+0.07%) ⬆️
...e/templates/dev/head/services/NavigationService.js 4.16% <4.16%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92c4ecf...b10980e. Read the comment docs.

Copy link
Contributor

@bansalnitish bansalnitish left a 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.

@geetchoudhary
Copy link
Contributor Author

@bansalnitish yes, I just checked it again and it was working fine for me, are all the other things working as expected?

@geetchoudhary
Copy link
Contributor Author

geetchoudhary commented Dec 13, 2018

Sir, I am also attaching a video link in which I am testing the same.
Drive link

@bansalnitish
Copy link
Contributor

Yes you're right @geetchoudhary, the working of these looks okay but did you check the working of About tab ? This is not working as expected.

@geetchoudhary
Copy link
Contributor Author

geetchoudhary commented Dec 13, 2018

Yes you're right @geetchoudhary, the working of these looks okay but did you check the working of About tab ? This is not working as expected.

@bansalnitish , There was nothing specified about the working of about tab in the issue #4936. Neither I have made any changes to it.

@bansalnitish
Copy link
Contributor

Yeah, I know this PR doesn't includes anything related to the working of about tab. I think when the PR was made it did fix the about tab but again it's not working as expected.

Anyway, I'll review your PR within few hours. It's quite similar to PR.

@bansalnitish bansalnitish self-assigned this Dec 13, 2018
@geetchoudhary
Copy link
Contributor Author

Thanks :)

Copy link
Contributor

@bansalnitish bansalnitish left a 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:

  1. 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.

  2. 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 to All 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.

  3. 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 and Language 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!

@geetchoudhary
Copy link
Contributor Author

@bansalnitish I have fixed the major issue. PTAL.

Copy link
Contributor

@bansalnitish bansalnitish left a 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!

Copy link
Contributor

@bansalnitish bansalnitish left a 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!

@geetchoudhary
Copy link
Contributor Author

@bansalnitish Please check the changes.

Copy link
Contributor

@bansalnitish bansalnitish left a 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 ?

@nithusha21
Copy link
Contributor

I'll defer to @DubeySandeep :)

@bansalnitish
Copy link
Contributor

@geetchoudhary any updates on this one ?

Copy link
Contributor

@bansalnitish bansalnitish left a 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)

@geetchoudhary
Copy link
Contributor Author

@geetchoudhary any updates on this one ?

@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.

@bansalnitish
Copy link
Contributor

HI @geetchoudhary,
Any updates here ?

@geetchoudhary
Copy link
Contributor Author

geetchoudhary commented Dec 22, 2018

HI @geetchoudhary,
Any updates here ?

Hi @bansalnitish , I created a Service (NavigationService)

screenshot 2018-12-22 at 11 23 30 am

The service is working fine with SearchBarDirective.js with the following code

screenshot 2018-12-22 at 11 25 41 am

But the same service is not working with TopNavigationBarDirective.js

screenshot 2018-12-22 at 11 27 18 am

screenshot 2018-12-22 at 11 28 00 am

Can you please help me out?

@bansalnitish
Copy link
Contributor

bansalnitish commented Dec 23, 2018

Hi @geetchoudhary, It's a bit hard to review the code through screenshots. Can you please push these changes?
Thanks

@geetchoudhary geetchoudhary changed the title Fix: 4936 The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. WIP : Fix: 4936 The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Dec 24, 2018
@geetchoudhary
Copy link
Contributor Author

Hi @geetchoudhary, It's a bit hard to review the code through screenshots. Can you please push these changes?
Thanks

@bansalnitish PTAL.

Copy link
Contributor

@bansalnitish bansalnitish left a 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.

@ankita240796 ankita240796 changed the title WIP : Fix: 4936 The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Dec 24, 2018
Copy link
Contributor

@bansalnitish bansalnitish left a 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.

core/templates/dev/head/services/NavigationService.js Outdated Show resolved Hide resolved
@oppiabot
Copy link

oppiabot bot commented Dec 24, 2018

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!

@geetchoudhary geetchoudhary changed the title Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. WIP: Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Dec 26, 2018
@geetchoudhary geetchoudhary changed the title WIP: Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Fix #4936: The dropdown menus work similar to what the about and profile dropdown behave with the keyboard. Dec 26, 2018
@geetchoudhary
Copy link
Contributor Author

@bansalnitish . PTAL.

Copy link
Contributor

@bansalnitish bansalnitish left a 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!

core/templates/dev/head/services/NavigationService.js Outdated Show resolved Hide resolved
@bansalnitish
Copy link
Contributor

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?

@geetchoudhary
Copy link
Contributor Author

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
$scope.currentUrl = window.location.pathname.split("/")[1];

I was getting this error
1

@bansalnitish
Copy link
Contributor

You resolved the merge conflicts above, right ?

@geetchoudhary
Copy link
Contributor Author

You resolved the merge conflicts above, right ?

Yes, everything is okay now.

@bansalnitish
Copy link
Contributor

bansalnitish commented Dec 26, 2018

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
Anyways, thanks!

Copy link
Contributor

@bansalnitish bansalnitish left a 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!

@geetchoudhary
Copy link
Contributor Author

geetchoudhary commented Dec 28, 2018

@bansalnitish , Kindly merge.

@bansalnitish bansalnitish merged commit 618344f into oppia:develop Dec 28, 2018
@geetchoudhary geetchoudhary deleted the tabnavigation branch December 30, 2018 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants