Skip to content

Commit 9f229b4

Browse files
committed
Add support for disabling the Ok button in GModal component
1 parent 193affd commit 9f229b4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client/src/components/BaseComponents/GModal.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const props = defineProps<{
3333
title?: string;
3434
/** Fixes the height of the modal to a pre-set height based on `size` */
3535
fixedHeight?: boolean;
36+
/** Disables the Ok button */
37+
okDisabled?: boolean;
38+
/** Title to show when the Ok button is disabled */
39+
okDisabledTitle?: string;
3640
}>();
3741
3842
const emit = defineEmits<{
@@ -170,7 +174,13 @@ defineExpose({ showModal, hideModal });
170174

171175
<div v-if="props.confirm" class="g-modal-confirm-buttons">
172176
<GButton @click="hideModal(false)"> {{ props.cancelText ?? "Cancel" }} </GButton>
173-
<GButton color="blue" @click="hideModal(true)"> {{ props.okText ?? "Ok" }} </GButton>
177+
<GButton
178+
:disabled="okDisabled"
179+
:disabled-title="okDisabledTitle"
180+
color="blue"
181+
@click="hideModal(true)">
182+
{{ props.okText ?? "Ok" }}
183+
</GButton>
174184
</div>
175185
</footer>
176186
</section>

0 commit comments

Comments
 (0)