Completed
Last Updated: 11 Oct 2017 14:04 by ADMIN
ADMIN
Danail Vasilev
Created on: 27 Nov 2013 12:13
Category: Button
Type: Bug Report
1
FIX: Click event is not fired when tapping on an element outside a RadTreeView after selecting a node from RadTreeView with EnableDragAndDrop="True" in iOS and Android
RadButton configured as an Image button cannot be clicked if a node from a RadTreeView is selected and EnableDragAndDrop property of the RadTreeView is set to true. The issue is reproducible in iPAD.

For the time being either the EnableDragAndDrop property of the RadTreeView can be set to false or the following JavaScript code can be placed after the declaration of the RadTreeView:

<script type="text/javascript">
                    var $T = Telerik.Web.UI;
                    Telerik.Web.UI.RadTreeView.prototype._onDocumentMouseUp = function (e) {
                        if ($telerik.isTouchDevice) {
                            //this._cancelEvent(e);

                            if (this.longTouchID) {
                                clearTimeout(this.longTouchID);
                                this.longTouchID = 0;
                            }
                            this._treeTouchScroll._dragCanceled = false;
                        }

                        this._detachDragDropEvents();

                        if (!this._dragging) {
                            this._initialDragMousePos = null;
                            this._initialDragNode = null;
                            return;
                        }

                        var sourceNodes = this._sourceDragNodes,
                target = $telerik.getTouchTarget(e);

                        var destinationNode = null;
                        if (target == this._dropClue) {
                            // If the event has hit the DropClue we take the node it is attached to
                            destinationNode = this._dropClue.treeNode;
                        }
                        else {
                            destinationNode = this._extractNodeFromDomElement(target);
                        }

                        if (destinationNode) {
                            if (destinationNode._isDescendantOf(this._initialDragNode) || this._initialDragNode == destinationNode) {
                                this._clearDrag();
                                return;
                            }
                        }

                        var htmlElement = target;

                        var eventArgs = new $T.RadTreeNodeDroppingEventArgs(sourceNodes, destinationNode, htmlElement, this._draggingPosition, e);
                        this.raiseEvent("nodeDropping", eventArgs);
                        if (eventArgs.get_cancel()) {
                            this._clearDrag();
                            return;
                        }

                        htmlElement = eventArgs.get_htmlElement();
                        var command = this._getDropCommand(destinationNode, sourceNodes, htmlElement);

                        if (command.commandName) {
                            eventArgs = new $T.RadTreeNodeDroppedEventArgs(sourceNodes, e);
                            this.raiseEvent("nodeDropped", eventArgs);
                            this._postback(command);
                        }

                        this._clearDrag();
                    };
                </script>
0 comments