Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11997 closed feature (plugin)

Feature enhancement: Add hasModifiers() to jQuery.Event

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


I'd propose a method for events which would be true if any of shiftKey, metaKey, etc are true.

This is an important use case for PJAX/HTML5-history apps following the practice of graceful degradation. You create a normal link and hijack it to open the page via Ajax using event.preventDefault(). However, this behaviour breaks user expectations when a modifier is in effect - users will expect the link to act as a normal link and open in a new tab/window or open the popup menu. So a convenience method would be useful in many modern web apps.

Change History (1)

comment:1 Changed 11 years ago by dmethvin

Resolution: plugin
Status: newclosed

This seems better as a plugin, or simply as app-specific code. It wouldn't get used at all within touch-based apps, for example.

Note: See TracTickets for help on using tickets.