EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: bdearborn on February 08, 2021, 10:22:30 AM



Title: Masked Input - Paste Broken
Post by: bdearborn on February 08, 2021, 10:22:30 AM
The Masked Input doesn't update the value when text is pasted into the input:

<input
   id="myPhone"
   name="myPhone"
   type="text"
   class="easyui-maskedbox"
   mask="999-999-9999"
   value=""
   data-options="">

Paste 123-456-7890 into the box and the underlying control value doesn't update.


Title: Re: Masked Input - Paste Broken
Post by: jarry on February 09, 2021, 07:35:37 AM
Please add a 'paste' event handler to the 'maskedbox' component.
Code:
$.extend($.fn.maskedbox.defaults.inputEvents, {
paste: function(e){
var target = e.data.target;
setTimeout(function(){
var text = $(target).maskedbox('getText');
$(target).maskedbox('setValue', text);
},0)
}
})


Title: Re: Masked Input - Paste Broken
Post by: bdearborn on February 09, 2021, 05:30:47 PM
Thank you!