Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct the type of <details>'s onToggle event handler #10938

Merged
merged 2 commits into from
May 20, 2024

Conversation

btea
Copy link
Contributor

@btea btea commented May 14, 2024

fix #10928

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.7 kB 34.5 kB 31.1 kB
vue.global.prod.js 148 kB 53.7 kB 48 kB

Usages

Name Size Gzip Brotli
createApp 50.8 kB 19.9 kB 18.1 kB
createSSRApp 54.1 kB 21.2 kB 19.3 kB
defineCustomElement 53.1 kB 20.6 kB 18.8 kB
overall 64.5 kB 24.9 kB 22.6 kB

packages/runtime-dom/src/jsx.ts Outdated Show resolved Hide resolved
@@ -406,7 +406,7 @@ export interface DataHTMLAttributes extends HTMLAttributes {

export interface DetailsHTMLAttributes extends HTMLAttributes {
open?: Booleanish
onToggle?: Event
onToggle?: (payload: ToggleEvent) => void
Copy link

@frsimond frsimond May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used the tooling in place to fix this locally on my project. Dont know if it is good practice or not.

interface DetailsHTMLEvents {
    onToggle?: ToggleEvent;
}
export interface DetailsHTMLAttributes extends HTMLAttributes, EventHandlers<DetailsHTMLEvents> {
    open?: Booleanish;
}

@haoqunjiang
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented May 20, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@haoqunjiang haoqunjiang merged commit fd18ce7 into vuejs:main May 20, 2024
11 checks passed
@haoqunjiang haoqunjiang changed the title fix: details tag onToggle type error fix: correct the type of <details>'s onToggle event handler May 20, 2024
@btea btea deleted the fix/details-html-onToggle-type branch May 20, 2024 11:52
lynxlangya pushed a commit to lynxlangya/core that referenced this pull request May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged. scope: types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toggle event throws error on details element
4 participants