SyntaxInput proposal
See original GitHub issueThis is a proposal for a new component in grommet version 2. The purpose of the component is to simplify the experience of adding text data that requires a certain syntax, such as IP addresses, data and time strings, etc.
Some notable aspects:
- The caller would specify a
schema
describing the available syntax. - A placeholder will be generated if one isn’t provided.
- The user could tab between input segments.
- The user does not have to type the separator characters but they will be allowed to if they want to.
- Any options would be rendered as a drop down when the user is interacting with a particular segment.
- The user could paste an entire value and it will be coerced into the schema if possible.
Here is an example of using the component to capture a time value:
<SyntaxInput
schema={[
{
length: 2,
options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
placeholder: 'hh',
},
{ separator: ':' },
{
length: 2,
options: ['00', '15', '30', '45'],
placeholder: 'mm',
},
{ separator: ' ' },
{
length: 2,
options: ['am', 'pm'],
placeholder: 'ap',
}
]}
value={value}
onChange={this.onChange}
/>
Please let us know if this is of interest and any feedback you might have.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (8 by maintainers)
Top Results From Across the Web
A Proposal of an Input Interface to Syntax :Collaboration of Syntax ...
Semantic Scholar extracted view of "A Proposal of an Input Interface to Syntax :Collaboration of Syntax with Pragmatics" by 中島 平三.
Read more >QiChat - Syntax — Aldebaran 2.1.4.13 documentation
Syntax. proposal: %tag sentence u:(input) %tag answer. Usage. Allows you to identify one or several proposal(s) or rule(s) by a tag.
Read more >QiChat - Syntax - QiSDK
Syntax. proposal: %bookmark sentence u:(input) %bookmark answer. Usage. Allows you to identify one or several proposal(s) or rule(s) by a Bookmark.
Read more >Re: a modest proposal for input syntax - GNU mailing lists - GNU.org
Subject: Re: a modest proposal for input syntax ... Bert > My biggest problem in typing input is getting notes in the correct...
Read more >Proposal: New callback syntax closer to function signature - Dash ...
Secondly, the new syntax is more compact (at least in the current form). Rather than importing “Input/Output/State”, you only need a single “prop”...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed on using this for credit cards, where after the first few digits are typed, the schema can be adjusted to align with the type of card.
I wasn’t thinking a single SyntaxInput would be used for all fields you mention.
Hi! Sorry to bump this thread, but how would you implement a submit function once the enter is pressed? I was thinking about
Keyboard
but that event would grab all the enters that were pressed