carbon-design-system / carbon-addons-cloud-react

[DEPRECATED] React components for the Cloud Add-on
http://cloud.carbondesignsystem.com/
Apache License 2.0
13 stars 23 forks source link

feat(InteriorLeftNav): default active href prop #83

Open TheSharpieOne opened 5 years ago

TheSharpieOne commented 5 years ago

Currently setting activeHref means that any time any prop updates, it resets the internal activeHref to the prop. Because of this, there is no way to set the initial default active href and then let the component's logic take over when items are clicked. This add defaultActiveHref (naming similar to input's value vs defaultValue) to allow for unmanaged activeHref to be defaulted. It is mostly needed when window.location.pathname doesn't work (such as when links have hashes).

Changelog

New

TheSharpieOne commented 5 years ago

@zeusorion 👀