diff --git a/CHANGELOG.md b/CHANGELOG.md index cc235d8e..f209a16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ### [@coreui/react](https://coreui.io/) changelog +##### `v2.0.9` +- feat(Sidebar): badge on parent dropdown - thanks @jeff-nz +- fix(SidebarNav): handleClick() target->currentTarget open +- chore(demo): style.css update to `@coreui/coreui v2.0.15` + ##### `v2.0.8` - refactor(SidebarMinimizer): extract `togglePs` method - refactor(SidebarMinimizer): for use `togglePs` method diff --git a/demo/src/scss/style.css b/demo/src/scss/style.css index 614b2d0c..db6c6ee2 100644 --- a/demo/src/scss/style.css +++ b/demo/src/scss/style.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /*! * CoreUI - Open Source Dashboard UI Kit - * @version v2.0.14 + * @version v2.0.15 * @link https://coreui.io * Copyright (c) 2018 creativeLabs Ɓukasz Holeczek * Licensed under MIT (https://coreui.io/license) @@ -11828,6 +11828,10 @@ canvas { transition: transform .3s, -webkit-transform .3s; } +.sidebar .nav-dropdown-toggle .badge { + margin-right: 16px; +} + .sidebar .nav-dropdown.open { background: rgba(0, 0, 0, 0.2); } @@ -12068,6 +12072,11 @@ canvas { margin-top: 2px; } +*[dir="rtl"] .sidebar .nav-link.nav-dropdown-toggle .badge { + margin-right: auto; + margin-left: 16px; +} + *[dir="rtl"] .sidebar-minimized .sidebar .nav { list-style-type: disc; } diff --git a/package.json b/package.json index a1817cca..bdcff6ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "2.0.8", + "version": "2.0.9", "description": "CoreUI React Bootstrap 4 components", "license": "MIT", "author": { diff --git a/src/SidebarNav.js b/src/SidebarNav.js index a18385c2..51b92e8a 100644 --- a/src/SidebarNav.js +++ b/src/SidebarNav.js @@ -41,7 +41,7 @@ class AppSidebarNav extends Component { handleClick(e) { e.preventDefault(); - e.target.parentElement.classList.toggle('open'); + e.currentTarget.parentElement.classList.toggle('open'); } activeRoute(routeName, props) { @@ -111,7 +111,7 @@ class AppSidebarNav extends Component { const classIcon = classNames('nav-icon', item.icon); return (
  • - {item.name} + {item.name}{this.navBadge(item.badge)}
      {this.navList(item.children)}