Bug Tracker

Ticket #873 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

Re-work Triggered Events

Reported by: john Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2 Component: event
Version: 1.1.4 Keywords:
Cc: Needs: Test Case

Description (last modified by brandon) (diff)

This is how event triggering should be re-worked:

.trigger("event"):

  • Should be cancellable.
  • Should only trigger bound event handlers.

.triggerAction("event")

  • Should trigger default browser action
  • Should not be cancellable
  • Should not allow clicking on links in IE
  • If no action exists, call trigger("event")

.click()

  • Should use triggerAction

Attachments

Change History

Changed 2 years ago by john

  • need set to Test Case
  • description changed from Currently, it can only be canceled using return false - it should work both ways. to This is how event triggering should be re-worked: .trigger("event"): * Should be cancellable. * Should only trigger bound event handlers. .triggerAction("event") * Should trigger default browser action * Should not be cancellable * Should not allow clicking on links in IE * If no action exists, call trigger("event") .click() * Should use triggerAction
  • summary changed from A triggered event can't be canceled with .preventDefault() to Re-work Triggered Events

Changed 2 years ago by brandon

So .click() will only use triggerAction and will not use trigger at all?

Changed 2 years ago by john

Correct - but triggerAction will call trigger if no default action exists. (Since default actions end up triggering the event handlers anyway.)

Changed 2 years ago by brandon

  • description changed from This is how event triggering should be re-worked: .trigger("event"): * Should be cancellable. * Should only trigger bound event handlers. .triggerAction("event") * Should trigger default browser action * Should not be cancellable * Should not allow clicking on links in IE * If no action exists, call trigger("event") .click() * Should use triggerAction to This is how event triggering should be re-worked: .trigger("event"): * Should be cancellable. * Should only trigger bound event handlers. .triggerAction("event") * Should trigger default browser action * Should not be cancellable * Should not allow clicking on links in IE * If no action exists, call trigger("event") .click() * Should use triggerAction

A related ticket is #1192.

Changed 2 years ago by julienw

I'd like to swap "trigger" and "triggerAction" in this description. otherwise, existing script that use "trigger" to trigger default browser actions would break ! :)

On the other hand, "triggerAction" would give a new feature... and that's exactly what your description of "trigger" is.

Changed 1 year ago by john

  • status changed from new to closed
  • version changed from 1.1 to 1.1.4
  • resolution set to fixed
  • milestone changed from 1.1.3 to 1.2

Fixed in SVN rev [3008].

Note: See TracTickets for help on using tickets.