From 443e2f9a557af4567315f71740ed2495b73e35bd Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Tue, 6 Oct 2020 23:27:38 +0300 Subject: [PATCH] Wrap search control selected items in list (https://github.com/woocommerce/woocommerce-admin/pull/5231) * Wrap search control selected items in list * Fix up snapshots --- .../src/search-list-control/index.js | 21 +- .../src/search-list-control/style.scss | 8 + .../test/__snapshots__/index.js.snap | 238 +++++++++--------- 3 files changed, 145 insertions(+), 122 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/index.js b/plugins/woocommerce-admin/packages/components/src/search-list-control/index.js index 9ae60ca51cd..be4b2e191a6 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/index.js +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/index.js @@ -209,14 +209,19 @@ export class SearchListControl extends Component { ) : null } - { selected.map( ( item, i ) => ( - - ) ) } + { selectedCount > 0 ? ( + + ) : null } ); } diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss b/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss index 3863f1848b6..1c4e9e9e581 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss @@ -22,6 +22,14 @@ .woocommerce-tag__text { max-width: 13em; } + + ul { + list-style: none; + + li { + float: left; + } + } } .woocommerce-search-list__search { diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap index 50500bbc0ce..e3e99bca5ec 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap @@ -1676,47 +1676,51 @@ exports[`SearchListControl should render a search box, a list of options, and 1 Clear all - - +
    +
  • - Clementine + + + Clementine + + + + - - - - +
  • +
- - +
    +
  • - Clementine + + + Clementine + + + + +
  • +
  • - - - - - - - Guava - - - - - +
  • +