         
         const rowIndex:int = eventRowIndex;
         var columnIndex:int = eventColumnIndex;
-        var pos:Point;
         
         var r:IVisualElement = event.itemRenderer; // grid.getItemRendererAt(rowIndex, eventColumnIndex);
         //trace("grid_gridMouseUpHandler: itemRenderer = " + event.itemRenderer);  
-        if (r && r != itemEditorInstance && 
+        if (r && r != editedItemRenderer && 
             (lastItemDown == r || (lastItemDown && grid.contains(DisplayObject(lastItemDown)))))
         {
             // if lastItemDown != r, we clicked in one cell and dragged to another.

     */
    private function editorAncestorResizeHandler(event:Event):void
    {
        endEdit("DataGridEventReason.OTHER");
    }
    
    /**

        
        // trace("endEdit from itemEditorFocusOut");
        if (itemEditorInstance || editedItemRenderer)
            endEdit();
        else
            destroyItemEditor();
            
