Skip to content

Commit

Permalink
Merge pull request #5568 from XavierChevalier/fix/sidebar-reactive-di…
Browse files Browse the repository at this point in the history
…smissable-property

fix(sidebar): dismissable property should still be reactive after mount
  • Loading branch information
tugcekucukoglu authored Apr 19, 2024
2 parents d930348 + b10e2c5 commit 4ed80b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/lib/sidebar/BaseSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ export default {
return {
$parentInstance: this
};
}
},
watch: {
dismissable(newValue) {
if (newValue) {
this.bindOutsideClickListener();
} else {
this.unbindOutsideClickListener();
}
}
},
};
</script>
8 changes: 8 additions & 0 deletions components/lib/sidebar/Sidebar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,12 @@ describe('Sidebar.vue', () => {

expect(wrapper.vm.containerVisible).toBeFalsy();
});

it('When component is mounted , dismissable property should still be reactive', async () => {
await wrapper.setProps({ dismissable: false, visible: true });

await wrapper.setProps({ dismissable: true });

expect(wrapper.vm.containerVisible).toBeTruthy();
});
});

0 comments on commit 4ed80b3

Please sign in to comment.