Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#3239 closed bug (wontfix)

Unable to cancel click event on buttons created in dialog

Reported by: tom Owned by: Scott González
Priority: minor Milestone:
Component: ui.dialog Version: 1.6b
Keywords: Cc:
Blocked by: Blocking:

Description

In the createButtons function of ui.dialog, the click handler for the created button is as follows:

$.each(buttons, function(name, fn) {
  $('<button/>')
    .text(name)
    .click(function() { fn.apply(self.element[0], arguments); })
    .appendTo(uiDialogButtonPane);
});

I suggest modifying the handler to return the value returned from the user function, allowing the cancellation of the event, as follows:

$.each(buttons, function(name, fn) {
  $('<button/>')
    .text(name)
    .click(function() { return fn.apply(self.element[0], arguments); })
    .appendTo(uiDialogButtonPane);
});

Change History (3)

comment:1 Changed 11 years ago by Scott González

Status: newaccepted

What is the use case for canceling the click event of a dialog button?

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

Resolution: wontfix
Status: acceptedclosed

comment:3 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.