Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close mobile navigator, when clicking on any navigation item #364

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Navigator/NavigatorCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,8 @@ export default {
* that points to another technology.
*/
handleNavigationChange(uid) {
// force-close the navigator on mobile
this.$emit('close');
dobromir-hristov marked this conversation as resolved.
Show resolved Hide resolved
// if the path is outside of this technology tree, dont store the uid
if (this.childrenMap[uid].path.startsWith(this.technologyPath)) {
this.setActiveUID(uid);
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/components/Navigator/NavigatorCard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,8 @@ describe('NavigatorCard', () => {
expect(getChildPositionInScroller).toHaveBeenCalledTimes(2);
expect(RecycleScrollerStub.methods.scrollToItem).toHaveBeenCalledTimes(1);
expect(RecycleScrollerStub.methods.scrollToItem).toHaveBeenLastCalledWith(2); // 3-rd item
// assert close event was emitted
expect(wrapper.emitted('close')).toHaveLength(1);
// now simulate the router change
wrapper.setProps({ activePath: [root0.path, root0Child1.path] });
await flushPromises();
Expand Down