Opened 9 years ago

Closed 6 years ago

#6049 closed bug (worksforme)

Link in sortable (portlets) - IE8

Reported by: raziel057 Owned by:
Priority: major Milestone: 2.0.0
Component: ui.sortable Version: 1.8.4
Keywords: IE8 Cc:
Blocked by: Blocking:

Description

If you try to add a link in the content of one portlet on the sample page: http://jqueryui.com/demos/sortable/portlets.html

With IE8, try to move the box which contains the link in the same column (on the top or bottom an other box) and try to click on the link after that. When you click on the link for the first time, it doesn't react.

Attachments (2)

simpletest.html (2.9 KB) - added by raziel057 9 years ago.
Llink inside a portlet
simpletest2.html (1009 bytes) - added by raziel057 9 years ago.
More simple test

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by raziel057

Attachment: simpletest.html added

Llink inside a portlet

Changed 9 years ago by raziel057

Attachment: simpletest2.html added

More simple test

comment:1 Changed 9 years ago by raziel057

The problem exists with a simple sortable list too.

It seems to come from an event handler which applies on links an is executed before href property. The event is apply when eleemnt is dragged.

comment:2 Changed 9 years ago by raziel057

If add the following code In widget ui.mouse, _mouseInit function the problem is solved!(see http://dev.jqueryui.com/ticket/4773)

// Prevent click on links in IE
if ($.browser.msie) {
	this._mouseUnselectable = this.element.attr('unselectable');
		this.element.attr('unselectable', 'on');
	}

Here the modified _mouseInit function:

_mouseInit: function() {
	var self = this;

	this.element
		.bind('mousedown.'+this.widgetName, function(event) {
			return self._mouseDown(event);
		})
		.bind('click.'+this.widgetName, function(event) {
			if(self._preventClickEvent) {
					
				// Prevent text selection in IE
				if ($.browser.msie) {
					this._mouseUnselectable = this.element.attr('unselectable');
						this.element.attr('unselectable', 'on');
				}
					
				self._preventClickEvent = false;
				event.stopImmediatePropagation();
				return false;
			}
		});
		this.started = false;
	},

Could you please review the modification and add the patch for a next version of jquery ui?

Thanks

comment:3 Changed 9 years ago by raziel057

As a workarround (without modification in widget ui=mouse, I add unbind instrtuction in simpletest2.html

$(function() {
	$("#sortable")
		.sortable()
		.unbind('click.sortable');
	});

But I must be a temporary solution.

comment:4 Changed 6 years ago by Scott González

Milestone: 1.next2.0.0

comment:5 Changed 6 years ago by mikesherov

Resolution: worksforme
Status: newclosed

Thanks for taking the time to contribute to the jQuery UI project! I can no longer reproduce the issue using the latest jQuery and jQuery UI. http://jsfiddle.net/sfYHu/2/

If you can still reproduce it, please feel free to reply to this ticket with a test case showing the problem. Thanks!

Note: See TracTickets for help on using tickets.