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(), )