From 10be366d1742d71dc0c670f5529acbd38f255dbc Mon Sep 17 00:00:00 2001 From: Nick Adams Date: Sat, 15 Jul 2023 02:56:15 -0600 Subject: [PATCH] feat(modal-property): additional exit functionality (#169) fix(accessibility): aria-label the close button for screenreaders docs: adds an example and escapable info section to documentation --- docs/components/modal.md | 28 ++++++++++++++++++- .../modal/examples/ModalEscapableExample.vue | 13 +++++++++ .../modal/examples/ModalExample.vue | 6 +++- src/components/Modal/Modal.vue | 23 +++++++++++++-- 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 docs/components/modal/examples/ModalEscapableExample.vue diff --git a/docs/components/modal.md b/docs/components/modal.md index ade6627..b098539 100644 --- a/docs/components/modal.md +++ b/docs/components/modal.md @@ -1,6 +1,7 @@ # Vue Modal - Flowbite @@ -53,7 +54,7 @@ function showModal() { ``` -## Sizes +## Size You can use four different modal sizing options starting from small to extra large, but keep in mind that the width of these modals will remain the same when browsing on smaller devices. @@ -75,3 +76,28 @@ import { Modal } from 'flowbite-vue' ``` + +## Escapable + +The escapable property is true by default to improve user experience and accessibility. + +This means that you may close the modal by + + - Using the close button on the modal + - Clicking outside of the modal + - Pressing the escape key + +In some situations, your user may be required to interact with the modal content. If this is the case, you can set the `escapable` property to false. The developer can then choose when they want to close the modal. + +Demo: + + +```vue + + +``` diff --git a/docs/components/modal/examples/ModalEscapableExample.vue b/docs/components/modal/examples/ModalEscapableExample.vue new file mode 100644 index 0000000..bf5f58b --- /dev/null +++ b/docs/components/modal/examples/ModalEscapableExample.vue @@ -0,0 +1,13 @@ + + diff --git a/docs/components/modal/examples/ModalExample.vue b/docs/components/modal/examples/ModalExample.vue index 699141c..ff5a911 100644 --- a/docs/components/modal/examples/ModalExample.vue +++ b/docs/components/modal/examples/ModalExample.vue @@ -3,7 +3,7 @@ - +