Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd action on Firefox and modals #11

Open
anlek opened this issue Oct 29, 2018 · 1 comment
Open

Odd action on Firefox and modals #11

anlek opened this issue Oct 29, 2018 · 1 comment

Comments

@anlek
Copy link

anlek commented Oct 29, 2018

I have a modal that I'm loading a form, that form has a "Edit" mode and in edit mode you can delete the item. Here is Chrome preforming the expected action:
2018-10-29 11 01 36

However, in Firefox (Firefox Developer Edition 63.0b9) the modal seems to be clicked on before the element inside it:
2018-10-29 11 01 13

  div.step.flex-row.align-items-center.justify-content-between(
    v-click-outside="focusLost"
    v-focus-outside="focusLost"
  )
    // content inside was removed

It seems that the select box is losing focus because of the click on the delete button, however, somehow the modal is gaining the focus (which is outside the div).

My temporary solution was to remove the v-focus-outside="focusLost" and it worked correctly in FF.

@nchutchind
Copy link
Owner

Sorry for the delay in responding... I didn't know there was an issue sitting here.

It would be difficult to diagnose without a sandbox example to look at. I would like to see a small example, if possible.

Based on what you're saying, it could have a lot to do with how the modal is implemented in those different browsers. It may be possible to solve by looking at the event and element being passed to the handler. Which ui library is the modal from?

The handler method is only called if the event target isn't a child of (or the element proper) that the v-*-outside was placed on. The fact that you're seeing something different means that the browser must be rendering elements in such a way that your event is happening on an element that is unexpected (which would be a browser difference and not a bug with vue-outside-events).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants