Skip to content

Commit

Permalink
fix(prompt): fix initial page offset for checkbox and select prompt (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar authored Mar 28, 2024
1 parent fba0969 commit da56395
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prompt/_generic_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ export abstract class GenericList<
return 0;
}
const height: number = this.getListHeight();
return Math.floor(index / height) * height;
return Math.min(
Math.floor(index / height) * height,
this.options.length - height,
);
}

/**
Expand Down

0 comments on commit da56395

Please sign in to comment.