Bug Tracker

Ticket #873 (closed bug: fixed)

Opened 8 years ago

Last modified 7 years ago

Re-work Triggered Events

Reported by: john Owned by:
Priority: major Milestone: 1.2
Component: event Version: 1.1.4
Keywords: Cc:
Blocking: Blocked by:

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

Change History

comment:1 Changed 8 years ago by john

  • need set to Test Case
  • Description modified (diff)
  • Summary changed from A triggered event can't be canceled with .preventDefault() to Re-work Triggered Events

comment:2 Changed 8 years ago by brandon

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

comment:3 Changed 8 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.)

comment:4 Changed 7 years ago by brandon

  • Description modified (diff)

A related ticket is #1192.

comment:5 Changed 7 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.

comment:7 Changed 7 years 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.