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): Provide option to not autofocus on first item #2473

Merged
merged 1 commit into from Jul 8, 2019

Conversation

@jeff-phillips-18
Copy link
Member

jeff-phillips-18 commented Jul 8, 2019

What:
Fixes Dropdown to not autofocus when custom children are given. Also provides the option to not autofocus on the first item for the case where the application wants to set autoFocus on one of the items.

Additional issues:

Fixes #2472

@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Jul 8, 2019

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

Copy link
Contributor

TheRealJon left a comment

lgtm

@jeff-phillips-18 jeff-phillips-18 requested review from redallen and dlabaj Jul 8, 2019
Copy link
Contributor

redallen left a comment

I'm just nitpicking :)

else {
(focusTarget.current.focus && focusTarget.current.focus()) ||
(focusTarget && ReactDOM.findDOMNode(focusTarget.current).focus()); // eslint-disable-line react/no-find-dom-node
const { autoFocus } = this.props;

This comment has been minimized.

Copy link
@redallen

redallen Jul 8, 2019

Contributor

Could also destructure component.


if (this.props.component === 'ul' && autoFocus) {
const focusTarget =
this.refsCollection.filter(

This comment has been minimized.

Copy link
@redallen

redallen Jul 8, 2019

Contributor

.find() is equivalent to .filter()[0].

@redallen redallen merged commit f094b2d into patternfly:master Jul 8, 2019
8 checks passed
8 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_integration Your tests passed on CircleCI!
Details
ci/circleci: build_pf3_docs Your tests passed on CircleCI!
Details
ci/circleci: build_pf4_docs Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test_jest_other Your tests passed on CircleCI!
Details
ci/circleci: test_jest_pf4 Your tests passed on CircleCI!
Details
ci/circleci: upload_docs Your tests passed on CircleCI!
Details
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Jul 8, 2019

Your changes have been released in:

  • @patternfly/react-core@3.67.1
  • @patternfly/react-docs@4.8.67
  • @patternfly/react-inline-edit-extension@2.9.30
  • demo-app-ts@2.8.1
  • @patternfly/react-table@2.14.4
  • @patternfly/react-topology@2.6.1
  • @patternfly/react-virtualized-extension@1.1.63

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.