@@ -28,10 +28,7 @@ const isNonKeyModifier = /*@__PURE__*/ makeMap(
2828)
2929// left & right could be mouse or key modifiers based on event type
3030const 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` )
3532
3633const resolveModifiers = (
3734 key : ExpressionNode ,
@@ -64,7 +61,9 @@ const resolveModifiers = (
6461 // runtimeModifiers: modifiers that needs runtime guards
6562 if ( maybeKeyModifier ( modifier ) ) {
6663 if ( isStaticExp ( key ) ) {
67- if ( isKeyboardEvent ( ( key as SimpleExpressionNode ) . content ) ) {
64+ if (
65+ isKeyboardEvent ( ( key as SimpleExpressionNode ) . content . toLowerCase ( ) )
66+ ) {
6867 keyModifiers . push ( modifier )
6968 } else {
7069 nonKeyModifiers . push ( modifier )
@@ -133,7 +132,7 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
133132 if (
134133 keyModifiers . length &&
135134 // if event name is dynamic, always wrap with keys guard
136- ( ! isStaticExp ( key ) || isKeyboardEvent ( key . content ) )
135+ ( ! isStaticExp ( key ) || isKeyboardEvent ( key . content . toLowerCase ( ) ) )
137136 ) {
138137 handlerExp = createCallExpression ( context . helper ( V_ON_WITH_KEYS ) , [
139138 handlerExp ,
0 commit comments