|
@ -983,7 +983,14 @@ class LayoutView(BaseView): |
|
|
|
|
|
|
|
|
# sorted by row, which in LayoutView indicates the position of the component in the |
|
|
# 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. |
|
|
# payload instead of in which ActionRow it should be placed on. |
|
|
key = lambda i: (i._rendered_row or i._row or sys.maxsize) + 1 |
|
|
|
|
|
|
|
|
def key(item: Item) -> int: |
|
|
|
|
|
if item._rendered_row is not None: |
|
|
|
|
|
return item._rendered_row |
|
|
|
|
|
if item._row is not None: |
|
|
|
|
|
return item._row |
|
|
|
|
|
return sys.maxsize |
|
|
|
|
|
|
|
|
for i in sorted(self._children, key=key): |
|
|
for i in sorted(self._children, key=key): |
|
|
components.append(i.to_component_dict()) |
|
|
components.append(i.to_component_dict()) |
|
|
|
|
|
|
|
|