-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
input[maxlength]
breaks a grapheme cluster down into pieces
#7861
Comments
This kind of falls at the boundary between HTML and UI Events, and UI Events is unfortunately not that maintained... Maybe the best we can do is throw in something into HTML. Is this kind of limitation something browsers are implemented in implementing? |
I can take a look at the implementation some day if @annevk is okay with that. |
Yeah, seems like a reasonable thing to fix. I suppose an argument could be made that how |
I tend to agree with @annevk that this could be browser specific. It might also be useful for the browser to indicate to the user visually that truncation has occurred. For example,some emoji sequences can be really long. This family emoji (👨🏻👩🏼👧🏾👧🏿) has 12 code points (don't forget skin tone selectors). With I think that specifying Note that while the example features emoji, this also affects languages that use combining marks to form e.g. syllables. For example |
Thanks @aphillips for the great reminder about how complicated the world of text is :). For the HTML Standard, I guess the question is whether we say anything, and if so, how. I was thinking of expanding the existing text:
by adding a paragraph or sentence like:
|
Copy-pasting 🏳️⚧ into that input twice results in
🏳️⚧🏳
in both Firefox and Chrome, which is fairly unexpected for users and websites can't really control this. (mastodon/mastodon#18038)Can we specify that the cluster should not be broken down and instead be prevented altogether, so that the result can be
🏳️⚧
instead of🏳️⚧🏳
? (One counterpoint would be that this can't be consistently done for all browsers as the number of the clusters changes every time a Unicode update happen, but I'm not sure how it can cause actual interoperability issue in this case.)(#1467 shows
maxlength
is complicated as WebKit counts the emoji as a single character, but that's about the counting of the characters.)The text was updated successfully, but these errors were encountered: