The JS scripts used by the navigation pattern do not work properly when there are multiple navigation components on the screen. This introduces issues for #5165 , where we would like the nav component to be fully interactive in combined form, just as it is in singular form.
To Reproduce
Steps to reproduce the behavior:
Add multiple navigation components to the same page. Import the same navigation scripts in each component separately. A good way to do this is to checkout the combined navigation PR and then revert the commit that disabled its interactivity.
Observe console error:
Uncaught SyntaxError: redeclaration of const initNavigationSliding
Expected behavior
Multiple imports of the navigation scripts should not cause errors. The component's script should be encapsulated such that there can be multiple indepedent navigation components on the same DOM.
Describe the bug
The JS scripts used by the navigation pattern do not work properly when there are multiple navigation components on the screen. This introduces issues for #5165 , where we would like the nav component to be fully interactive in combined form, just as it is in singular form.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Multiple imports of the navigation scripts should not cause errors. The component's script should be encapsulated such that there can be multiple indepedent navigation components on the same DOM.
Further context MM thread