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(Dropdown): Do not focus Dropdown if menu is not opened #1222

Merged
merged 1 commit into from
Jan 21, 2019

Conversation

karelhala
Copy link
Contributor

What:
If user clicks anywhere on screen and dropdown is present it will automatically scroll to such dropdown even if it's not opened.

Additional issues:
RedHatInsights/insights-frontend-components#222

@karelhala
Copy link
Contributor Author

Honestly I think that this bug should have been fixed differently, but this works as a hot fix.

Proper fix would require adding domlisteners to DropdownMenu and triggering toggle from there because this menu is destroyed everytime we close it. Plus with this fix we would clean event listener (quite expensive to fire onToggle for multiple dropdowns).

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://1222-pr-patternfly-react-patternfly.surge.sh

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4066

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.008%) to 80.356%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/patternfly-4/react-core/src/components/Dropdown/Toggle.js 1 2 50.0%
Totals Coverage Status
Change from base Build 4063: -0.008%
Covered Lines: 4544
Relevant Lines: 5320

💛 - Coveralls

@jgiardino
Copy link
Collaborator

Thanks for submitting a bug fix for this! I wasn't able to reproduce this issue in the workspace, but also didn't see any issues with the dropdown after these changes.

Copy link
Collaborator

@jgiardino jgiardino left a comment

Choose a reason for hiding this comment

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

The interaction and behavior looks fine to me.

@karelhala
Copy link
Contributor Author

@jgiardino you can reproduce it by clicking on any dropdown, scrolling a bit so this dropdown is not visible and clicking anywhere on screen.

@jgiardino
Copy link
Collaborator

Ah, ok. Thanks for the clarification. I was able to see this issue.
😄👍

@jschuler jschuler merged commit 45367bc into patternfly:master Jan 21, 2019
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

6 participants