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

Addon support for TextInput #91

Closed
rishson opened this issue Mar 29, 2017 · 1 comment
Closed

Addon support for TextInput #91

rishson opened this issue Mar 29, 2017 · 1 comment
Assignees
Milestone

Comments

@rishson
Copy link
Contributor

rishson commented Mar 29, 2017

Specification

This widget builds on the existing textInput widget and allow the user to specify an 'addon'.

Below is an example of addons from bootstrap. It shows leading, trailing and multiple addons:

screen shot 2017-03-29 at 2 05 26 pm

Features

  • You can have both leading and trailing addons on a single textInput.
  • You can specify text, icon, or text + icon for either leading or trailing addons.
  • You can include form widgets such as a checkbox or radioCheckbox in an addon.

Value-add of the widget (e.g. why use rather than just use VDom directly)
builds on the existing textInput and offers visual prompts to aid completion, e.g. type of values accepted

List of callback funcs that can be passed in props (if any)
none

Mouse/keyboard interactions (if any)
possibility to show different tooltips when hovering over leading and trailing addons

Mandatory/valid/empty/wait states (if any)
none

Is the widget controlled/uncontrolled
as per textInput

List of any icons needed
any icon in font-awesome that we ship should be usable as either a leading or trailing icon.

Design input required
Need to consider how we style an invalid or mandatory input that has addons.
Need to consider using addons and putting a textInput into a wait state.
Need to consider how we style addons if the textInput is disabled.

Any other considerations:
Initial support will not include changing the icon based on validity of the textInput.
With an input of type search, will Addon provide all we need to effectively offer a Search widget?

Questions

Need to consider if the icons should be spoken as they are included for informative purposes.
Need to consider what happens if long text is specified for an addon. Do we ellid the text, always show, ..

Acceptance criteria

When I specify an addon with text and an invalid icon, then I expect the text to be rendered without the icon.
When I specify an addon with unicode text, then I expect it to render correctly (including adjusting for height of non-latin chars).

@smhigley smhigley self-assigned this Apr 4, 2017
@rishson rishson added this to the 2017.04 milestone Apr 5, 2017
@dylans dylans modified the milestones: 2017.04, 2017.05 Apr 29, 2017
@rishson rishson added beta3 and removed beta2 labels May 15, 2017
@eheasley eheasley modified the milestones: 2017.05, 2017.06 Jun 6, 2017
@dylans dylans modified the milestones: 2017.06, 2017.07 Jul 4, 2017
@kitsonk kitsonk changed the title Addon support for TextInput. Addon support for TextInput Jul 28, 2017
@dylans dylans modified the milestones: 2017.07, 2017.08 Jul 29, 2017
@kitsonk kitsonk modified the milestones: 2017.08, 2017.09 Sep 4, 2017
@eheasley eheasley removed the beta3 label Oct 3, 2017
@eheasley eheasley modified the milestones: 2017.09, 2017.10 Oct 6, 2017
@bitpshr
Copy link
Member

bitpshr commented Oct 20, 2017

This should be taken care of as part of the next round of components for beta4.

After discussions with the team over the past few weeks, it sounds like the best approach for this component would be to add an additional property (or two) to TextInput to handle leading and trailing add-on strings. Because there can be multiple add-on strings on each end of an input, each property may make the most sense as an array of strings. Alternatively, if the desire is to keep TextInput as clean as possible, a new component that uses a TextInput internally could be created that supports properties specific to add-ons.

Adding functionality (vs. modifying functionality) in this manner doesn't lend itself well to direct extension of TextInput. Specifically, because TextInput is highly accessible form control, its render method is inevitably large. While the generation of some of the necessary attributes and listeners could be offloaded to helper methods, extension is less than ideal to add functionality to a component with such little vdom with so many attributes.

Action items:

  • Leave this ticket open to track the creation of this component for beta4

@bitpshr bitpshr added the beta4 label Oct 20, 2017
@kitsonk kitsonk modified the milestones: 2017.10, beta.4 Oct 30, 2017
@morrinene morrinene added beta5 and removed beta4 labels Nov 3, 2017
@smhigley smhigley mentioned this issue Nov 28, 2017
3 tasks
@kitsonk kitsonk modified the milestones: beta.4, beta.5 Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants