qcy1121 / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
GNU General Public License v2.0
0 stars 0 forks source link

source code textarea focus issue on Chrome 27.0.1453.94 #231

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
=======================================================
1. Using Chrome Versión 27.0.1453.94 Under Windows 7 open exaple page  -> 
/jwysiwyg-master/help/examples/02-full.html
2. click on View Source Code button  
3. click on textarea

What is the expected output? What do you see instead?
=======================================================
Of course we expet to get focus on the textarea to edit contents and what 
happens is that it returns and keep focus on the wysiwyg editor

What version of the product are you using? On what operating system?
=======================================================
Environment: Chrome Versión 27.0.1453.94 / OS Windows 7

Product versions:

(WYSIWYG – jQuery plugin 0.98.dev)
      the plugin version available at https://github.com/akzhan/jwysiwyg/blob/master/jquery.wysiwyg.js

(WYSIWYG - jQuery plugin 0.97)

Please provide any additional information below.
=======================================================
(WYSIWYG – jQuery plugin 0.98.dev)
line 1397:
    $(self.original).focus(function () {
                if ($(this).filter(":visible").length === 0 || $.browser.opera) {
                    return;
                }
                self.ui.focus();
            });

(WYSIWYG - jQuery plugin 0.97)
line 1407:
    $(self.original).focus(function () {
                if ($(this).filter(":visible").length === 0 || $.browser.opera) {
                    return;
                }
                self.ui.focus();
            });

Well in both cases the following $(this).filter(":visible").length    is === 1 
(not 0) so evaluating to false it executes self.ui.focus() and the ui gains 
focus instead of the textarea on Chrome but on On IE 9, Firefox 18.0.1 and 
Opera 12.15 the focus doensn't gets away; it seems that the problem is on 
execution of self.ui.focus() but I did'n check that 

I hope you find this helpfull, as soon as I have time i'll take a look ar the 
rest of the execution flow to find the root of the problem.

Best regards
Jax

Original issue reported on code.google.com by jaxol...@gmail.com on 6 Jun 2013 at 2:28

GoogleCodeExporter commented 9 years ago
Don't know if this helps, but I changed the this.ui.focus code as such to work 
around it (the code at the lines you mention above implies that the code here 
is fixing some kind of bug that - honestly - doesn't seem related to the code 
in question at first glance, so I didn't want to mess with it).

Changing this however seems to work around the issue without messing with this 
patch code.  The better approach might be to determine whether the code snippet 
at the line above is actually needed at all, it seems very odd to me and I 
don't quite see how it fixes the problem that it claims it fixes.  But I 
digress.

        this.ui.focus = function () {
            var self = this.self;

            if (!self.viewHTML) {
                self.editor.get(0).contentWindow.focus();
            }

            return self;
        };

Original comment by edgarver...@gmail.com on 25 Jun 2013 at 11:50

GoogleCodeExporter commented 9 years ago
Has anyone solved this issues?

Original comment by shobhabs...@gmail.com on 12 Aug 2013 at 5:09