Skip to content

Commit

Permalink
Bump for Stimulus 3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Nov 30, 2022
1 parent f893b09 commit 004aed6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions app/assets/javascripts/stimulus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//= link ./stimulus-loading.js

/*
Stimulus 3.2.0
Stimulus 3.2.1
Copyright © 2022 Basecamp, LLC
*/
class EventListener {
Expand Down Expand Up @@ -173,13 +173,19 @@ const descriptorPattern = /^(?:(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)
function parseActionDescriptorString(descriptorString) {
const source = descriptorString.trim();
const matches = source.match(descriptorPattern) || [];
let eventName = matches[1];
let keyFilter = matches[2];
if (keyFilter && !["keydown", "keyup", "keypress"].includes(eventName)) {
eventName += `.${keyFilter}`;
keyFilter = "";
}
return {
eventTarget: parseEventTarget(matches[3]),
eventName: matches[1],
eventName,
eventOptions: matches[6] ? parseEventOptions(matches[6]) : {},
identifier: matches[4],
methodName: matches[5],
keyFilter: matches[2],
keyFilter,
};
}
function parseEventTarget(eventTargetName) {
Expand Down Expand Up @@ -255,7 +261,7 @@ class Action {
return false;
}
if (!Object.prototype.hasOwnProperty.call(this.keyMappings, standardFilter)) {
error(`contains unkown key filter: ${this.keyFilter}`);
error(`contains unknown key filter: ${this.keyFilter}`);
}
return this.keyMappings[standardFilter].toLowerCase() !== event.key.toLowerCase();
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/stimulus.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/javascripts/stimulus.min.js.map

Large diffs are not rendered by default.

0 comments on commit 004aed6

Please sign in to comment.