EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on May 19, 2015, 07:57:51 AM



Title: Setting Tab property with update() steals the current element focus
Post by: devnull on May 19, 2015, 07:57:51 AM
OK, I know that the first thing you will do is to ask me to vew a jsfiddle that proves there is no problem, but there is a problem and I have tried several times to resolve it.

In my app which has multiple levels of panels, tabs etc etc, when I include a multiline textbox, it does not like carriage returns.

if you enter a carriage return more than once, it will loose focus immediately, I suspect that it has something to do with the css whitespace property but if I create a simple jsfiddle I just cannot replicate the problem.

I have no event listeners on keydown or keyup listeners so it's got be something to do with easyui, but as I am unable to replicate the problem in jsfiddle I am now stuck !

Also, in Firefox, multiline textboxes do not show carriage returns, newlines, it is all 1 block of continuous text, but in Chrome the newlines are displayed correctly.


Title: Re: Strange Multiline textbox behavior
Post by: devnull on May 21, 2015, 12:25:38 AM
Ok, finally found the cause of this.

The tabs.update() method removes the focus from the current input element.

I have a multi-line textbox, that updates it's parent tab onChange, and when you hit a carriage return to move to the next line, instead of moving to the next line instead it fires the change event which updates the tab and takes focus away from the multiline text box - so you can only ever enter 1 newline withiut refocussing on the text box again.

No that I know, this can of course be overcome by resetting the focus back to the textbox, but it would be nice if the tab.update() event did not steal the focus.

I have adjusted the subject to reflect the cause.