I am not getting the desired behavior from my code.
AP.require(["history"], function(history) {
var diagramAnchorName = 'MyAnchor';
history.pushState(diagramAnchorName);
// Close viewer on back button
history.popState(function(e) {
if(viewer.isShowing()) {
viewer.close();
}
});
});When I put a breakpoint after history.pushState(), I can then execute history.getState() via console and get back the expected value ('MyAnchor'). However, the URL in the browser (Chrome) is never updated, and the back button goes back to the previous page, rather than executing my history.popState() callback.
Any advice would be very appreciated.