Skip to main content

Bug Tracker

Side navigation

#11997 closed feature (plugin)

Opened July 01, 2012 08:34PM UTC

Closed July 03, 2012 04:48PM UTC

Feature enhancement: Add hasModifiers() to jQuery.Event

Reported by: 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.

Attachments (0)
Change History (1)

Changed July 03, 2012 04:48PM UTC by dmethvin comment:1

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.