aidewoode / office-ui-fabric-vue

Office UI Fabric implementation for Vue.js
https://aidewoode.github.io/office-ui-fabric-vue/
Other
273 stars 30 forks source link

Remove Overlay v-model and use prop #24

Closed jak-hammond closed 5 years ago

jak-hammond commented 5 years ago

At the moment the ou-overlay supports a v-model property to control whether or not the overlay is visible. When the overlay is created, a click even is then added to it that closes the overlay whenever a user clicks on it, this emits an input event and sets the value to false.

The issue is, if I am passing in a prop to control when this overlay should/should not be visible, I do not want the user to close this when they click on it. Using v-model to achieve also seems a little wrong.

IMO the overlay needs v-model breaking into 2 props; closeOnClick and visible. This then lets the implementer control both the visibility and whether or not the user can close the overlay by clicking on it. It has the added benefit of removing the unnecessary input event emits too.

aidewoode commented 5 years ago

Hi, the behaviour of add close event on overlay element is defined on the office-ui-js. So this behaviour is on expected. Because the overlay component don't have callback when overlay closed, So I use v-model is just for track overlay visibility when user click overlay element to close it.