Html: Add `twitter` for `<input>`'s `type` and global `inputmode` attributes?

Created on 3 May 2019  Â·  8Comments  Â·  Source: whatwg/html

iOS's keyboard has a keyboard type twitter which means text with easy access to @ and #.

Nowadays @ and # are pretty much the de-facto way to mention people and add tag, so authors may want to be able to make use of this keyboard type. It would probably be good to provide this functionality to the web platform.

additioproposal needs implementer interest

Most helpful comment

If we do this, I'd prefer a more generic name such as "social-text" as this also applies to various other products, e.g., GitHub and Slack.

All 8 comments

If we do this, I'd prefer a more generic name such as "social-text" as this also applies to various other products, e.g., GitHub and Slack.

Yeah, I'm not proposing using the exact same name here, just the functionality.

Just an idea, but what about abstracting this into something like a common-characters attribute which could be used at the browsers discretion to provide easy access to additional keys; <input type="text" common-characters="@,#"> might be useful for social networking sites, while <input type="number". common-characters="+,-,*,/,="> would be useful for a calculator.

@keithamus do various platform APIs support that kind of setup? I was assuming they do not, given the dedicated twitter type linked above.

Yeah I imagine they don't, I'm mostly concerned that adding another input type which is just text with a different keyboard confuses the issue more. Even if browsers hooked off of fixed strings of common-characters there's still scope for extensibility.

I see, I don't think we should support this for type personally, only for inputmode, as it's about virtual keyboards only.

For inputmode we chose the intersection between what is supported on popular mobile platforms (Android and iOS). It is not possible to set a "twitter" keyboard on Android. There is a "short-text" type and I think we should try to understand how that behaves whether it provides the same functionality as the "twitter" keyboard on iOS.

WhatsApp, Youtube, Slack and many more would benefit from some punctuation characters being directly accessible for formatting / markup:

  • @: ping, mention
  • #: tag
  • _: emphasis (underline, italic)
  • *: emphasis (bold)
  • `: code (fixed width)
  • ~: edit (strike-through)
  • :: emoji shortcode

Note, this is not enough for markdown, wiki, HTML, BBCode etc. LWL

Was this page helpful?
0 / 5 - 0 ratings

Related issues

empijei picture empijei  Â·  3Comments

petamoriken picture petamoriken  Â·  3Comments

lespacedunmatin picture lespacedunmatin  Â·  3Comments

lazarljubenovic picture lazarljubenovic  Â·  4Comments

benjamingr picture benjamingr  Â·  3Comments