-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
transition:name
can't use Chinese、Japanese and Korean, etc.
#9803
Comments
transition:name
can't use Chinese transition:name
can't use Chinese、Japanese and Korean, etc.
This is causing me a lot of problems and causing my site animations to fail. I checked the commit history and found that this PR did a replacement process for Why do this, I think it's a break change. |
It looks like the astro/packages/astro/src/runtime/server/transition.ts Lines 26 to 29 in 457e8b6
|
As you can see, I'm having trouble choosing the right label here. This is definitely not an edge case, but it also does not contradict the documented behavior. The browser only accepts a limited range of characters for view-transition-names. |
Maybe we can encode it using |
Even if the intention is good, it's not so nice to change the characters without notice :-) Maybe we can do better on auto escaping, but I think we should definitively issue warning when changing names. |
Yeah. We need give a warning when change the user passed value. |
This would yield %E5%BC%80%E6%BA%90 which is also illegal, but I know what you mean and would agree to auto-escaping if we find a robust way to do so. |
I took a quick look and didn’t immediately spot a definitive CSS ident escaping tool, but yes I’d be +1 on auto-escaping if possible and definitely warning in case someone is using the name elsewhere in their CSS. |
This might be a bit bumpy, but I'll take a look. |
I'll also take a look. |
Is it possible to use Although longer, they are all legal characters |
Great! Thanks a lot, happy to do so! |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Chrome
Describe the Bug
Set a element
transition:name
totransition:name={name}
The name is Chinese text.
Read Astro code:
This will cause the Chinese name to be replaced with empty, resulting in multiple duplicates of the name.
My website as example:
https://liruifengv.com/tags/
I think the same will be true for Japanese and Korean, etc.
What's the expected result?
Expect Chinese to be used correctly as transition:name.
CSS identifiers can be Chinese、Japanese and Korean, etc.
Link to Minimal Reproducible Example
https://liruifengv.com/tags/
Participation
The text was updated successfully, but these errors were encountered: