RonaldJerez / vue-input-facade

A lightweight and dependency free input masking library created specific for Vue
https://ronaldjerez.github.io/vue-input-facade/latest/
183 stars 27 forks source link

fix(directive.js): fix handling events for multiple elements #41

Closed dougalg closed 3 years ago

dougalg commented 3 years ago

Description

Partially resolves https://github.com/RonaldJerez/vue-input-facade/issues/40

Problem: If two input elements with the v-facade directive are both in the same root element, then the event handlers for each will trigger for ALL inputs on the elements. This can be problematic in cases where an input event cannot or should not be handled by the masking function, ie when one input is masked and the other is not.

Solution: Add a check to the event handle to confirm that the event target is in fact the element that we care about.

Checklist

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.3.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: