From 6122b32dae10ebeb6ad5989675836ea0b41d8631 Mon Sep 17 00:00:00 2001 From: DA-344 <108473820+DA-344@users.noreply.github.com> Date: Tue, 6 May 2025 16:54:13 +0200 Subject: [PATCH] fix: Sorting LayoutView children defaulting to 0 instead of sys.maxsize --- discord/ui/view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ui/view.py b/discord/ui/view.py index d8c21354c..0f9a552a3 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -791,7 +791,8 @@ class LayoutView(BaseView): # sorted by row, which in LayoutView indicates the position of the component in the # payload instead of in which ActionRow it should be placed on. - for child in sorted(self._children, key=lambda i: i._rendered_row or 0): + key = lambda i: i._rendered_row or i._row or sys.maxsize + for child in sorted(self._children, key=key): components.append( child.to_component_dict(), )