diff --git a/.github/workflows/design-library-deploy-storybook-dev.yml b/.github/workflows/design-library-deploy-storybook-dev.yml index 650438f1..ac3eefb2 100644 --- a/.github/workflows/design-library-deploy-storybook-dev.yml +++ b/.github/workflows/design-library-deploy-storybook-dev.yml @@ -57,7 +57,6 @@ jobs: app_location: "design-library/storybook-static" skip_app_build: true skip_api_build: true - skip_deploy_on_missing_secrets: true close_pull_request: if: github.event_name == 'pull_request' && github.event.action == 'closed' diff --git a/design-library/src/components/BccModal/BccModal.stories.ts b/design-library/src/components/BccModal/BccModal.stories.ts index 59ada42d..c3d7804d 100644 --- a/design-library/src/components/BccModal/BccModal.stories.ts +++ b/design-library/src/components/BccModal/BccModal.stories.ts @@ -47,7 +47,7 @@ const Template: StoryFn = (args) => ({ }); /** - * Control the content of the modal with the `title` prop and the `default` slot. Pass buttons to the `primaryAction` and `secondaryAction` slots. Set `closeButton` to `false` to hide the close button on desktops. The modal emits a `close` event when the user clicks the close button or closes the modal by clicking outside of it or pressing Escape. + * Control the content of the modal with the `title` prop and the `default` slot. Pass buttons to the `primaryAction` and `secondaryAction` slots. Set `closeButton` to `false` to hide the close button on desktops. The modal emits a `close` event when the user clicks the close button or closes the modal by clicking outside of it or pressing Escape, unless `closeOnOutsideClick` is set to false. */ export const Example = Template.bind({}); Example.args = { diff --git a/design-library/src/components/BccModal/BccModal.vue b/design-library/src/components/BccModal/BccModal.vue index dd480e51..86b14c65 100644 --- a/design-library/src/components/BccModal/BccModal.vue +++ b/design-library/src/components/BccModal/BccModal.vue @@ -13,22 +13,30 @@ type Props = { open: boolean; title?: string; closeButton?: boolean; + closeOnOutsideClick?: boolean; }; const props = withDefaults(defineProps(), { open: false, closeButton: true, + closeOnOutsideClick: true, }); const emit = defineEmits(["close"]); const slots = useSlots(); const showCloseButton = computed(() => props.closeButton && !slots.header); + +const handleClose = () => { + if (props.closeOnOutsideClick) { + emit("close"); + } +};