@@ -28,10 +28,7 @@ const isNonKeyModifier = /*@__PURE__*/ makeMap(
28
28
)
29
29
// left & right could be mouse or key modifiers based on event type
30
30
const maybeKeyModifier = /*@__PURE__ */ makeMap ( 'left,right' )
31
- const isKeyboardEvent = /*@__PURE__ */ makeMap (
32
- `onkeyup,onkeydown,onkeypress` ,
33
- true ,
34
- )
31
+ const isKeyboardEvent = /*@__PURE__ */ makeMap ( `onkeyup,onkeydown,onkeypress` )
35
32
36
33
const resolveModifiers = (
37
34
key : ExpressionNode ,
@@ -64,7 +61,9 @@ const resolveModifiers = (
64
61
// runtimeModifiers: modifiers that needs runtime guards
65
62
if ( maybeKeyModifier ( modifier ) ) {
66
63
if ( isStaticExp ( key ) ) {
67
- if ( isKeyboardEvent ( ( key as SimpleExpressionNode ) . content ) ) {
64
+ if (
65
+ isKeyboardEvent ( ( key as SimpleExpressionNode ) . content . toLowerCase ( ) )
66
+ ) {
68
67
keyModifiers . push ( modifier )
69
68
} else {
70
69
nonKeyModifiers . push ( modifier )
@@ -133,7 +132,7 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
133
132
if (
134
133
keyModifiers . length &&
135
134
// if event name is dynamic, always wrap with keys guard
136
- ( ! isStaticExp ( key ) || isKeyboardEvent ( key . content ) )
135
+ ( ! isStaticExp ( key ) || isKeyboardEvent ( key . content . toLowerCase ( ) ) )
137
136
) {
138
137
handlerExp = createCallExpression ( context . helper ( V_ON_WITH_KEYS ) , [
139
138
handlerExp ,
0 commit comments