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 Help menu display bug - Task-1211 #5214

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

RuthShryock
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Run ./python-format.sh to make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes
  8. Create a testing plan for the reviewer and add it to the Testing section
  9. Add frontend or backend tag and any other appropriate tags to this pull request

Notes

watchOutsideClose() was called whenever the HelpBubble was clicked and displayed the Help Resources popup content. This added a click handler (outsideClickHandler) that checked if the click event happened on any of the elements in the popup content. If a click event matched the conditions specified, it would trigger the close() function.

The bug was due to the fact that clicks on the HelpBubble itself were not being excluded. This means that even if the user clicked on the HelpBubble in order to open the popup, it would register as an "outside click" and close the popup. This fix ensures that the popup will only close if the click occurs outside the entire HelpBubble component.

Note: this behavior was only triggered when there are no notifications because watchOutsideClose() is only called when there are no active in-app messages. This explains why the Help menu is displayed on kf.beta due to a notification message being present.

Testing

  1. Checkout main and try clicking on the Help button in the lower left-hand corner.
  2. Verify that nothing shows up.
  3. Checkout this branch and verify that clicking on the Help button displays the Help Resources popup.
  4. Verify that the esc key closes the popup.
  5. Verify that clicking outside the popup closes it as well.
  6. Verify that clicking the X closes the popup.
  7. Verify that toggling the Help button closes the popup.

Copy link

Help menu does not open

Copy link
Contributor

@pauloamorimbr pauloamorimbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works for me! 👌🏻

@pauloamorimbr pauloamorimbr changed the title Fix Help menu display bug Fix Help menu display bug - Task-1211 Oct 30, 2024
@RuthShryock RuthShryock merged commit 7034148 into release/2.024.33 Oct 30, 2024
7 checks passed
@RuthShryock RuthShryock deleted the help-menu-display-bug branch October 30, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants