Skip to content

Commit e52af6c

Browse files
authored
fix: select menu for paginators over 25 pages (#1604)
1 parent 6c12971 commit e52af6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interactions/ext/paginators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,14 @@ def create_components(self, disable: bool = False) -> List[ActionRow]:
271271

272272
if self.show_select_menu:
273273
current = self.pages[self.page_index]
274+
lower_index = max(0, min(len(self.pages) - 25, self.page_index - 12))
274275
output.append(
275276
StringSelectMenu(
276277
*(
277278
StringSelectOption(
278279
label=f"{i+1} {p.get_summary if isinstance(p, Page) else p.title}", value=str(i)
279280
)
280-
for i, p in enumerate(self.pages)
281+
for i, p in enumerate(self.pages[lower_index : lower_index + 25], start=lower_index)
281282
),
282283
custom_id=f"{self._uuid}|select",
283284
placeholder=f"{self.page_index+1} {current.get_summary if isinstance(current, Page) else current.title}",

0 commit comments

Comments
 (0)