Skip to content

Commit

Permalink
♻️ Refactor the tabIndex finding logic for a better readability as pe…
Browse files Browse the repository at this point in the history
…r the PR review

#5011 (comment)
  • Loading branch information
Balaji Sridharan committed Jul 28, 2024
1 parent cf752c3 commit 6df7994
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/month.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,8 @@ export default class Month extends Component<MonthProps> {
this.isMonthDisabledForLabelDate(preSelectedMonth);

const tabIndex =
!this.props.disabledKeyboardNavigation &&
m === preSelectedMonth &&
!isPreSelectedMonthDisabled
!(isPreSelectedMonthDisabled || this.props.disabledKeyboardNavigation)
? "0"
: "-1";

Expand All @@ -867,9 +866,8 @@ export default class Month extends Component<MonthProps> {
);

const tabIndex =
!this.props.disabledKeyboardNavigation &&
q === preSelectedQuarter &&
!isCurrentQuarterDisabled
!(isCurrentQuarterDisabled || this.props.disabledKeyboardNavigation)
? "0"
: "-1";

Expand Down

0 comments on commit 6df7994

Please sign in to comment.