Opened 10 years ago

Closed 9 years ago

#5629 closed bug (duplicate)

Dialog: first focusable element bug

Reported by: Scott González Owned by:
Priority: critical Milestone: 1.9.0
Component: ui.dialog Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:

Description

jQuery 1.4.2 now sorts when using .add(), which breaks the logic for finding the first focusable element in dialogs.

Change History (2)

comment:1 Changed 9 years ago by jawsper

Encountered this bug too, have a hack to fix for now:

Old:

		$([])
			.add(uiDialog.find('.ui-dialog-content :tabbable:first'))
			.add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
			.add(uiDialog)
			.filter(':first')
			.focus();

New:

		var x = uiDialog;
		var y = uiDialog.find('.ui-dialog-content :tabbable:first');
		var z = uiDialog.find('.ui-dialog-buttonpane :tabbable:first');
		if(y.length) x = y;
		if(z.length) x = z;
		x.focus( );

comment:2 Changed 9 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #5767.

Note: See TracTickets for help on using tickets.