Skip to content

Commit

Permalink
Rename pastEnd to pastSectionEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanu1 committed Nov 24, 2021
1 parent da616ae commit aa0166a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sample-app/src/components/DropdownSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface DropdownSectionProps {
options: Option[],
optionIdPrefix: string,
onFocusChange?: (value: string, focusedOptionId: string) => void,
onLeaveSectionFocus?: (pastEnd: boolean) => void,
onLeaveSectionFocus?: (pastSectionEnd: boolean) => void,
onClickOption?: (option: Option, optionIndex: number) => void,
label?: string,
cssClasses: {
Expand Down
8 changes: 4 additions & 4 deletions sample-app/src/components/InputDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ export default function InputDropdown({

/**
* Handles changing which section should become focused when focus leaves the currently-focused section.
* @param pastEnd Whether the section focus left from the end or the beginning of the section.
* @param pastSectionEnd Whether the section focus left from the end or the beginning of the section.
*/
function onLeaveSectionFocus(pastEnd: boolean) {
if (focusedSectionIndex === undefined && pastEnd) {
function onLeaveSectionFocus(pastSectionEnd: boolean) {
if (focusedSectionIndex === undefined && pastSectionEnd) {
dispatch({ type: 'FocusSection', newIndex: 0 });
} else if (focusedSectionIndex !== undefined) {
let newSectionIndex: number | undefined = pastEnd
let newSectionIndex: number | undefined = pastSectionEnd
? focusedSectionIndex + 1
: focusedSectionIndex - 1;
if (newSectionIndex < 0) {
Expand Down

0 comments on commit aa0166a

Please sign in to comment.