diff --git a/discord/ui/view.py b/discord/ui/view.py index 964eb82e1..1f2e9848d 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -785,9 +785,9 @@ 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. - key = lambda i: i._rendered_row or i._row or sys.maxsize - for _, cmps in groupby(self._children, key=key): - components.extend(c.to_component_dict() for c in cmps) + key = lambda i: (i._rendered_row or i._row or sys.maxsize) + 1 + for i in sorted(self._children, key=key): + components.append(i.to_component_dict()) return components