Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

IE8: DesignMode(true) via OnFocus cause control to lose focus #101

Open FlowIT-JIT opened 4 years ago

FlowIT-JIT commented 4 years ago

An input control which is switched to DesignMode via its OnFocus event lose focus, but does not fire OnBlur, nor does it fire OnFocus again (which is good) if it regains focus, e.g. by user interaction.

The control should remain focused while DesignMode loads.

Related code:

https://github.com/Jemt/Fit.UI/blob/fcbaa5fb4524b4f677e03882e803966f31563a09/Controls/Input/Input.js#L945 image

and

https://github.com/Jemt/Fit.UI/blob/fcbaa5fb4524b4f677e03882e803966f31563a09/Controls/Input/Input.js#L988 image

The problem is probably the last part which is not able to change focus from the outer container to the editable area. IE8 might require this to be postponed using setTimeout. Take care not to cause an error if control is disposed once timer executes (make sure 'me' is not null first!)!