FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(Dropdown): Provide option to not autofocus on first item by jeff-phillips-18 · Pull Request #2473 · patternfly/patternfly-react · GitHub

fix(Dropdown): Provide option to not autofocus on first item - #2473

Merged
redallen merged 1 commit into
patternfly:masterfrom
jeff-phillips-18:dropdown
Jul 8, 2019
Merged

fix(Dropdown): Provide option to not autofocus on first item#2473
redallen merged 1 commit into
patternfly:masterfrom
jeff-phillips-18:dropdown

Conversation

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Collaborator

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

TheRealJon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

redallen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could also destructure component.


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

redallen merged commit f094b2d into patternfly:master Jul 8, 2019

Copy link
Copy Markdown
Collaborator

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! 🎉

jeff-phillips-18 deleted the dropdown branch May 12, 2022 12:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

PF4 Dropdown should allow callers to specify the initial focus item

4 participants


Back | FazBrowse Home | New Git URL