Skip to content

Commit

Permalink
Fixed #3753 - ConfirmDialog: Add draggable property
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Mar 16, 2023
1 parent baf767f commit bfca2f0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api-generator/components/confirmdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const ConfirmDialogProps = [
type: 'object',
default: 'null',
description: 'Object literal to define widths per screen size.'
},
{
name: 'draggable',
type: 'boolean',
default: 'true',
description: 'Whether the dialog can be relocated by dragging.'
}
];

Expand Down
5 changes: 5 additions & 0 deletions components/confirmdialog/ConfirmDialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export interface ConfirmDialogProps {
* @see ConfirmDialogBreakpoints
*/
breakpoints?: ConfirmDialogBreakpoints;
/**
* Enables dragging to change the position using header.
* @defaultValue true
*/
draggable?: boolean | undefined;
}

/**
Expand Down
18 changes: 17 additions & 1 deletion components/confirmdialog/ConfirmDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<template>
<CDialog v-model:visible="visible" role="alertdialog" class="p-confirm-dialog" :modal="true" :header="header" :blockScroll="blockScroll" :position="position" :breakpoints="breakpoints" :closeOnEscape="closeOnEscape" @update:visible="onHide">
<CDialog
v-model:visible="visible"
role="alertdialog"
class="p-confirm-dialog"
:modal="true"
:header="header"
:blockScroll="blockScroll"
:position="position"
:breakpoints="breakpoints"
:closeOnEscape="closeOnEscape"
:draggable="draggable"
@update:visible="onHide"
>
<template v-if="!$slots.message">
<i v-if="confirmation.icon" :class="iconClass" />
<span class="p-confirm-dialog-message">{{ message }}</span>
Expand All @@ -24,6 +36,10 @@ export default {
breakpoints: {
type: Object,
default: null
},
draggable: {
type: Boolean,
default: true
}
},
confirmListener: null,
Expand Down

0 comments on commit bfca2f0

Please sign in to comment.