diff --git a/src/components/list_group/__snapshots__/list_group_item.test.js.snap b/src/components/list_group/__snapshots__/list_group_item.test.js.snap index 26fc39e957d9..685a2976fa6f 100644 --- a/src/components/list_group/__snapshots__/list_group_item.test.js.snap +++ b/src/components/list_group/__snapshots__/list_group_item.test.js.snap @@ -146,6 +146,24 @@ exports[`EuiListGroupItem props isDisabled is rendered 1`] = ` `; +exports[`EuiListGroupItem props onClick and href is rendered 1`] = ` +
  • + + + Label + + +
  • +`; + exports[`EuiListGroupItem props onClick is rendered 1`] = `
  • `; - -exports[`EuiListGroupItem throws an warning if both onClick and href are provided but still renders 1`] = ` -
  • - - - -
  • -`; diff --git a/src/components/list_group/list_group_item.js b/src/components/list_group/list_group_item.js index 95444f5f776f..b3cf946f7eb9 100644 --- a/src/components/list_group/list_group_item.js +++ b/src/components/list_group/list_group_item.js @@ -92,15 +92,11 @@ export const EuiListGroupItem = ({ if (href && !isDisabled) { itemContent = ( - + {iconNode} {labelContent} ); - - if (onClick) { - console.warn('Both `href` and `onClick` were passed to EuiListGroupItem but only one can exist. The `href` was used.'); - } } else if ((href && isDisabled) || onClick) { itemContent = (