EasyUI Forum
June 15, 2024, 11:38:25 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: IE9+ focus issue  (Read 4687 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: September 14, 2015, 07:59:01 AM »

I'm having an issue that I've verified on a couple PCs where when you type text in a easyui-textbox then switch to another window, then switch back the text box gets cleared.  this only happens in IE and happens in both IE9 mode and in Edge on Win7 and Win8.1.  If you click the page so the easyui-textbox doens't have focus then it doesn't happen.  it only happens when focus goes from another window directly to the textbox, either via alt-tab or clicking.  I haven't only been able to reproduce it when using jeasyUI, older pages that do not use jeasyUI do not have the issue.

I've set up a test page http://test.mywilsonmfg.com/focus/focus.html this is extracted from my framework's output so some of it seems like odd layout, but it's reusable stuff to make design easier. 

My attempts to debug using IE's dev tools have been futile.  I added an on focus event handler and set a breakpoint, which stops and the text is still there, but stepping the code does not step anywhere except that handler, and the text disappears, sometimes just by waiting a bit at the breakpoint. 
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 14, 2015, 05:20:18 PM »

Please update the easyui to the latest version, or override the 'setText' method of textbox.
Code:
$.extend($.fn.textbox.methods, {
setText: function(jq, value){
return jq.each(function(){
var opts = $(this).textbox('options');
var input = $(this).textbox('textbox');
value = value == undefined ? '' : String(value);

if ($(this).textbox('getText') != value){
input.val(value);
}
opts.value = value;
if (!input.is(':focus')){
if (value){
input.removeClass('textbox-prompt');
} else {
input.val(opts.prompt).addClass('textbox-prompt');
}
}
$(this).textbox('validate');
});
}
})
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #2 on: September 15, 2015, 06:08:23 AM »

that worked.  thank you.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!