I would like my dash-component to be able to change the navitem/subnavitem which is rendered active if a callback changes the href or pathname of dcc.Location. This doesn’t trigger an event with the _dashprivate_historychange event type (see below).
I created a navigation dash-component which uses _dashprivate_historychange (dash/History.js at dev · plotly/dash · GitHub) to render the activated navitem and subnavitem as active. This works if i click on a _Link.react.js inside the navitem/subnavitem and if i click on a dcc.Link somewhere else on the page.
Do you have any ideas how i would best be able to trigger an _dashprivate_historychange event in a dash callback OR how else i could make my dash-component url-change aware?
Thanks for mentioning the dbc-nav implementation, i was already using it as a reference. The navigation (dash-bootstrap-components) has the same problem, it won’t update its active navlink when dcc.location changes due to a button click:
Ah interesting. I think it would make sense if Location dispatched an event when it was changed by a callback. Maybe worth raising an issue on the dash-core-components repo?