Results 1 to 2 of 2

Thread: [4.1.2] injectEvent problem under IE

    You found a bug! We've classified it as EXTJS-7284 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    164
    Vote Rating
    0
      0  

    Default [4.1.2] injectEvent problem under IE

    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.1.2


    Browser versions tested against:
    • IE9


    DOCTYPE tested against:
    • <!DOCTYPE html>


    Description:
    • If use iframe with ExtJS then 'injectEvent' method of EventObject in parent page causes few issues. If iframe inside a window then window dragging is interrupted. Also, if open window with iframe, close and open again then an error occurs in handleSingleEvent of EventManager. The issue doesn't occur in 4.1.1


    Steps to reproduce the problem:
    • Open the sample from above test case (it contains from two files: main page and page is loaded inside iframe)
    • Click on the button to show a window
    • Try to drag the window
    • Notice that dragging performance is bad (in 4.1.1 the dragging is smooth)
    • Close the window and click again on the button
    • Exception occurs in handleSingleEvent method of EventManager (on 'attachItem.firing = true;' line, attachItem is null)


    The result that was expected:
    • All should works correctly like in 4.1.1


    The result that occurs instead:
    • Window dragging is interrupted
    • An error occurs after window reopening


    Test Case:

    Main page
    Code:
        <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
    	<script type="text/javascript" src="../../ext-all.js"></script>
    
    	<script type="text/javascript">		
    		
    		function showWindow() {
    			Ext.create("Ext.window.Window", {				
    				layout: "fit",
    				width: 300,
    				height: 300,
    				title : "Window with iframe",
    				closable: true,
    				items:[
    					{
    						xtype: "component",
    						autoEl : {
    							tag  : "iframe",							
    							src  : "child.html",
    							frameborder : 0
    						},
    						
    						onRelayedEvent : function  (event) {
    							var iframeEl = this.el,
    								iframeXY = iframeEl.getXY(),
    								eventXY = event.getXY();
    							
    							event.xy = [iframeXY[0] + eventXY[0], iframeXY[1] + eventXY[1]];
    
    							event.injectEvent(iframeEl);
    
    							event.xy = eventXY;
    						},
    						
    						listeners : {
    							beforedestroy : function () {
    								if (this.rendered) {									
    									Ext.EventManager.removeAll(this.el.dom.contentWindow.document);
    								}
    							},
    							afterrender : function () {
    								this.el.on("load", function(){
    									var doc = this.el.dom.contentWindow.document,
    										fn = this.onRelayedEvent;
    										
    									Ext.EventManager.removeAll(doc);
    									Ext.EventManager.on(doc, {
    										mousedown: fn, 
    										mousemove: fn,
    										mouseup: fn,
    										click: fn, 
    										dblclick: fn,
    										scope: this
    									});
    								}, this);
    							}
    						}
    					}
    				]
    			}).show();			
    		}
    		
    		Ext.onReady(function(){
    			Ext.create("Ext.button.Button", {
    				renderTo: Ext.getBody(),
    				text: "Show window",
    				handler: showWindow
    			});
    		});
        </script>
    	
    </head>
    <body>
    </body>
    </html>
    Page in iframe
    Code:
    <html>
    <head>
        <title></title>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
    	<script type="text/javascript" src="../../ext-all.js"></script>	
    </head>
    <body>
    </body>
    </html>

    HELPFUL INFORMATION
    If remove ExtJS from the iframe page then issues are gone

    Screenshot or Video:
    • none



    Debugging already done:
    • none


    Possible fix:
    • not provided


    Additional CSS used:
    • only default ext-all.css


    Operating System:
    • MS Vista
    Attached Files Attached Files

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •