rldjrsksl / flex-iframe

Automatically exported from code.google.com/p/flex-iframe
0 stars 0 forks source link

Blinking cursor stays while switching tabs in tabnavigator #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Go to
http://flex-iframe.googlecode.com/svn/trunk/examples/build/HTMLTest/HTMLTest.htm
l
(Tabbed nav demo)

2. Focus on Google input box, notice the blinking cursor (at this point if
you focus somewhere else and cursor disappears, it will work fine at step 3)

3. Switch to yahoo tab and see that cursor is still blinking.

What is the expected output? What do you see instead?
Cursor disappears when switching tabs. Now it stays blinking

What version of Flex-IFrame are you using? On what operating system and
which navigator (specify the version too)?
IE 7.0, it works fine with FireFox

Please provide any additional information below, and a sample Flex 3
project reproducing the issue if possible.

One possible solution would be to call some js function when hiding iframe
to switch focus?

Original issue reported on code.google.com by andrei.i...@gmail.com on 29 Dec 2009 at 4:23

GoogleCodeExporter commented 8 years ago
See code fix below, tested in FF 3.5.3 and IE 7

/**
        * The JavaScript code to call to insert the function that hides a Div in the 
DOM.
        */
        public static var INSERT_FUNCTION_HIDEDIV:String =
            "document.insertScript = function ()" +
            "{ " +
                "if (document." + FUNCTION_HIDEDIV + "==null)" +
                "{" +
                    FUNCTION_HIDEDIV + " = function (frameID)" +
                    "{" +

                        "document.getElementById(frameID).focus();" +
                        "document.getElementById(frameID).style.display='none';" +
                    "}" +
                "}" +
            "}";

public static var INSERT_FUNCTION_HIDEIFRAME:String =
            "document.insertScript = function ()" +
            "{ " +
                "if (document." + FUNCTION_HIDEIFRAME + "==null)" +
                "{" +
                    FUNCTION_HIDEIFRAME + " = function (frameID, iframeID)" +
                    "{" +
                        "var iframeRef = document.getElementById(iframeID);" +
                        "alert('Hiding iframe');" +
                        "var iframeDoc;" +
                        "if (iframeRef.contentWindow) {" +
                            "iframeDoc = iframeRef.contentWindow.document;" +
                        "} else if (iframeRef.contentDocument) {" +
                            "iframeDoc = iframeRef.contentDocument;" +
                        "} else if (iframeRef.document) {" +
                            "iframeDoc = iframeRef.document;" +
                        "}" +
                        "if (iframeDoc) {" +
                            "iframeDoc.body.style.display = 'none';" +
                        "}" +
                        "document.getElementById(frameID).style.display = 'none';" +
                        "document.getElementById(frameID).focus();" +
                    "}" +
                "}" +
            "}";

Original comment by andrei.i...@gmail.com on 30 Dec 2009 at 11:45

GoogleCodeExporter commented 8 years ago
Hi Andrei, is there a reason why you call focus() in the hide methods ? It looks
cleaner to me to have it in the show methods. Did you test this way ?

Original comment by Julien.N...@gmail.com on 30 Dec 2009 at 3:47

GoogleCodeExporter commented 8 years ago
Hi Julien,

Why would you want to call it on show?
I think the flow is following unless I am wrong:
IFrame destroyed by any means e.g. removed from stage, hide is called and it's 
focused to remove blinking cursor. I am not sure if show called in following 
scenario: I have Iframe1(with cursor) and IFrame2, when I switch to IFrame2 
e.g. 
calling visible = true on IFrame2 and visible false on IFrame1. If focus() is 
done 
in show, cursor from IFrame1 will still stay blinking.

Original comment by andrei.i...@gmail.com on 30 Dec 2009 at 4:08

GoogleCodeExporter commented 8 years ago
No, because the focus will have been set on IFrame2.
It is not very logical to set the focus on an element you are hiding...

Original comment by Julien.N...@gmail.com on 30 Dec 2009 at 4:20

GoogleCodeExporter commented 8 years ago
Oh right, did not think about it, I guess this would work as well

Original comment by andrei.i...@gmail.com on 30 Dec 2009 at 4:33

GoogleCodeExporter commented 8 years ago
On the second thought, I still think it meeds to be called at hide. The reason 
for 
this - tabnavigator can have second tab opened as flex tab.
E.g. Open Iframe tab 1 with input focused and when open tab 2 which is 
completely 
flex. When try switching between them (with focusing input in tab1), cursor 
will 
stay on flex tab 2.

Original comment by andrei.i...@gmail.com on 30 Dec 2009 at 7:15

GoogleCodeExporter commented 8 years ago
Looks somehow fixed in 1.4.5.

Original comment by Julien.N...@gmail.com on 14 May 2010 at 4:51