Skip to content

fix(language-core): keep event handler types of props with a deferred key set - #6319

Merged
johnsoncodehk merged 3 commits into
vuejs:masterfrom
ValentinYoushkevich:fix/resolve-event-pick
Dec 3, 2026
Merged

johnsoncodehk merged 3 commits into
vuejs:masterfrom
ValentinYoushkevich:fix/resolve-event-pick

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

Since v3.3.12, an inline handler on a component whose props include ExtractPropTypes<'input'> loses its parameter type (TS7006). Ark UI types its ark.* factory components this way, e.g. field-input.vue.

<script setup lang="ts">
declare const Comp: new () => {
	$props: ExtractPropTypes<'input'> & { onFoo?: (num: number) => void };
};
</script>

<template>
	<Comp @foo="num => num" /> <!-- TS7006 -->
</template>

#6179 narrowed the props to { [K in onEvent]?: Props[K & keyof Props] }. With a deferred keyof, K & keyof Props doesn't resolve and the handler type becomes unknown. Pick keeps it.

@johnsoncodehk
johnsoncodehk merged commit 4511f69 into vuejs:master Dec 3, 2026
3 checks passed
@ValentinYoushkevich
ValentinYoushkevich deleted the fix/resolve-event-pick branch December 4, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants