File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,11 @@ export default {
3434 },
3535 computed: {
3636 config () {
37- return {
37+ const config = !! this . mask && {
3838 mask: this .mask ,
3939 tokens: this .tokens
4040 }
41+ return config
4142 },
4243 listeners () {
4344 const vm = this
@@ -50,7 +51,7 @@ export default {
5051 refresh (event ) {
5152 let emittedValue = event ? event .target .value : this .value
5253
53- if (! this .masked ) {
54+ if (this . mask && ! this .masked ) {
5455 const maskerConfig = {
5556 mask: this .mask ,
5657 tokens: this .tokens ,
Original file line number Diff line number Diff line change @@ -43,9 +43,11 @@ export function getInputElement(el) {
4343export function inputHandler ( event ) {
4444 const { target } = event
4545
46+ // do not run this function is there is no mask config
47+ if ( ! target [ CONFIG_KEY ] . config ) return false
4648 // we only need to run this method on native events (isTrusted == true for native events)
47- // since we will be emitting our own input event we can stop propagation of the native event
4849 if ( ! event . isTrusted ) return false
50+ // since we will be emitting our own input event we can stop propagation of the native event
4951 event . stopPropagation ( )
5052
5153 // gather some information from the input before masking
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ export default {
2020 update : ( el , { value, oldValue } ) => {
2121 el = core . getInputElement ( el )
2222
23- if ( value != oldValue ) {
23+ if ( value !== oldValue ) {
2424 el [ CONFIG_KEY ] . config = core . normalizeConfig ( value )
2525 core . updateValue ( el , { force : true } )
26- } else if ( el . value !== el [ CONFIG_KEY ] . oldValue ) {
26+ } else {
2727 core . updateValue ( el )
2828 }
2929 } ,
You can’t perform that action at this time.
0 commit comments