From 62c7bf13920523e69a30fea98c68da0055a6100e Mon Sep 17 00:00:00 2001 From: Phil Schanely Date: Tue, 23 Aug 2022 11:03:32 -0400 Subject: [PATCH] chore: adjust from feedback --- .../app/views/sage_components/_sage_list.html.erb | 4 +--- packages/sage-react/lib/List/List.jsx | 14 ++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/lib/sage_rails/app/views/sage_components/_sage_list.html.erb b/docs/lib/sage_rails/app/views/sage_components/_sage_list.html.erb index 4cbe760078..92ed7ad808 100644 --- a/docs/lib/sage_rails/app/views/sage_components/_sage_list.html.erb +++ b/docs/lib/sage_rails/app/views/sage_components/_sage_list.html.erb @@ -1,8 +1,6 @@ <% tag = component.sortable ? "ol" : "ul" -if component.tag.present? - tag = component.tag -end +tag = component.tag || tag drag_handle_type = component.drag_handle_type.present? ? component.drag_handle_type : "default" %> <<%= tag %> diff --git a/packages/sage-react/lib/List/List.jsx b/packages/sage-react/lib/List/List.jsx index 2630729317..0efb6cf2d9 100644 --- a/packages/sage-react/lib/List/List.jsx +++ b/packages/sage-react/lib/List/List.jsx @@ -45,9 +45,7 @@ export const List = ({ }; let Tag = sortable ? 'ol' : 'ul'; - if (tag) { - Tag = tag; - } + Tag = tag || Tag; return sortable ? ( {renderItems()} @@ -94,11 +92,11 @@ List.defaultProps = { children: null, className: null, items: [], - itemRenderer: () => null, + itemRenderer: () => {}, dragHandleType: List.DRAG_HANDLE_TYPES.DEFAULT, - onEnd: () => null, - onStart: () => null, - setList: () => [], + onEnd: () => {}, + onStart: () => {}, + setList: () => {}, sortable: false, tag: null, };