question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UiModal, which event is emitted when close button or outside is clicked?

See original GitHub issue

In version 1.0.1: Which is the event that is fired when the close is triggered for an UiModal? It seems that these 2 have the same purpose (by reading the docs):

close
Emitted when the modal is hidden (i.e. when the close transition completes).Listen for it using @close.

hide
Emitted when the modal close transition completes.Listen for it using @hide.

In version 0.8.9 I think I used @close

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JosephusPayecommented, Sep 30, 2017

Hi @EmilMoe,

Currently, the way the modal is opened/closed is by adding a ref to the modal and then calling the open() method on it.

It doesn’t use v-show. The hide/close events are used for doing something after the modal is opened or closed.

Here’s an example:

<div id="app">
    <ui-modal ref="exampleModal" title="Example Modal">Some text here.</ui-modal>
    <ui-button color="primary" @click="openModal">Open Modal</ui-button>
</div>
new Vue({
    el: '#app',
    methods: {
        openModal() {
            this.$refs.exampleModal.open();
        }
    }
});

See here for a working demo: https://codepen.io/JosephusPaye/pen/OxgrBZ?editors=1010

0reactions
JosephusPayecommented, Jan 28, 2019

Updated docs to explain difference between open/reveal and hide/hidden in https://github.com/JosephusPaye/Keen-UI/commit/10b27ac968f8cc0912abb36c5c710db7229d4e5d

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle "outside" click on Dialog (Modal)?
In your Dialog tag remove the onClose event function. Then just add a button below let's say 'Cancel' then you can call function...
Read more >
Click Outside Modal - Beginner JavaScript - Wes Bos
We will work on clicking the button on each card now, starting by selecting them. Then we will loop over each of the...
Read more >
wire-elements/modal: Livewire component that provides you ...
To open a modal you will need to emit an event. To open the EditUser modal for ... By default, the modal will...
Read more >
How to build modals with Laravel and Livewire - Philo's Blog
The modal will close if you click outside the modal or hit the escape key. It's also possible to close the modal using...
Read more >
Options popup gets closed if user clicks/hovers outside
Is there a way we can do this in Flex Monster 2.8 and allow popups to close only by clicking on Apply/Cancel button?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found