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): handle on enter focusing when options are disabled #2025

Merged
merged 1 commit into from May 17, 2019

Conversation

@kmcfaul
Copy link
Contributor

kmcfaul commented May 16, 2019

What: fix for handling when options are disabled. Focus should be on the first non-disabled item.

Refer to issue: Fixes #2017

@kmcfaul kmcfaul added the PF4 label May 16, 2019
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented May 16, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented May 16, 2019

Codecov Report

Merging #2025 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2025      +/-   ##
==========================================
- Coverage   82.43%   82.41%   -0.03%     
==========================================
  Files         627      627              
  Lines        6951     6953       +2     
  Branches      119      119              
==========================================
  Hits         5730     5730              
- Misses       1162     1164       +2     
  Partials       59       59
Flag Coverage Δ
#patternfly3 84.88% <ø> (ø) ⬆️
#patternfly4 78.88% <0%> (-0.06%) ⬇️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...react-core/src/components/Dropdown/DropdownMenu.js 55.26% <0%> (-3.08%) ⬇️

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 b64bc3a...4066af2. Read the comment docs.

@@ -39,10 +39,14 @@ class DropdownMenu extends React.Component {

componentDidMount() {
if (this.props.openedOnEnter) {
if (this.props.component === 'ul') this.refsCollection[0].focus();
const focusTarget =
this.refsCollection.filter(

This comment has been minimized.

Copy link
@redallen

redallen May 17, 2019

Contributor

In the future, you can use .find() instead of .filter()[0]

@dlabaj dlabaj requested a review from tlabaj May 17, 2019
@tlabaj
tlabaj approved these changes May 17, 2019
Copy link
Contributor

tlabaj left a comment

LGTM

@tlabaj tlabaj merged commit 8903702 into patternfly:master May 17, 2019
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.