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

Auto focus disabled with a new prop #3324

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export default class Select extends Component<Props, State> {

openMenu(focusOption: 'first' | 'last') {
const { menuOptions, selectValue } = this.state;
const { isMulti } = this.props;
const { isMulti, disableAutoFocus } = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

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

missed flow type

Copy link
Author

Choose a reason for hiding this comment

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

Even the documentation is missing but I needed a confirmation if they're willing to merge this new feature.

Choose a reason for hiding this comment

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

Merge please.

Choose a reason for hiding this comment

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

It seems there is now a conflict in this merge request

let openAtIndex =
focusOption === 'first' ? 0 : menuOptions.focusable.length - 1;

Expand All @@ -504,7 +504,7 @@ export default class Select extends Component<Props, State> {
this.onMenuOpen();
this.setState({
focusedValue: null,
focusedOption: menuOptions.focusable[openAtIndex],
focusedOption: disableAutoFocus ? null : menuOptions.focusable[openAtIndex],
});

this.announceAriaLiveContext({ event: 'menu' });
Expand Down