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(runtime-dom): set text as an attribute for a tags #12212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jh-leong
Copy link
Member

close #12211

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+29 B) 38 kB (+7 B) 34.2 kB (+23 B)
vue.global.prod.js 159 kB (+29 B) 57.9 kB (+6 B) 51.5 kB (+15 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47 kB (+29 B) 18.3 kB (+5 B) 16.7 kB (+6 B)
createApp 55 kB (+29 B) 21.3 kB (+6 B) 19.4 kB (+33 B)
createSSRApp 59 kB (+29 B) 23 kB (+6 B) 20.9 kB (-6 B)
defineCustomElement 59.8 kB (+31 B) 22.9 kB (+9 B) 20.8 kB (-56 B)
overall 68.7 kB (+29 B) 26.4 kB (+7 B) 24 kB (-10 B)

Copy link

pkg-pr-new bot commented Oct 18, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@12212

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@12212

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@12212

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@12212

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@12212

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@12212

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@12212

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@12212

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@12212

vue

pnpm add https://pkg.pr.new/vue@12212

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@12212

commit: e9c954f

Comment on lines +125 to +128
// #12211 <a text> must be set as attribute
if (key === 'text' && el.tagName === 'A') {
return false
}
Copy link
Member

Choose a reason for hiding this comment

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

<a> element doesn't have a text attribute while HTMLAnchorElement has a text property. Not sure if we should add this or should let users to use ^text="..." instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I missed this detail, thanks for pointing it out.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not saying we shouldn't add this 😅

I just want to first discuss the criteria we use to handle such situations and whether we should first check if other frameworks have any special handling. I think we can keep this open for now.

@jh-leong jh-leong closed this Oct 18, 2024
@Justineo Justineo reopened this Oct 18, 2024
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.

Attribute text on a html tag overrides inner content
2 participants