bleeding-edge-sample-app icon indicating copy to clipboard operation
bleeding-edge-sample-app copied to clipboard

Restricted Textbox Component

Open brigand opened this issue 10 years ago • 9 comments

So... this component is weird. We probably at least want to improve the styles.

Here's an example of it in jsbin.

brigand avatar Aug 09 '14 01:08 brigand

I think this should be 3 components

1 controller with validation (needs more char - limit char) 1 textarea with onChange given to controller 1 label

controller onChange then to pass the val to the textarea and pass the count / max / has-error to the label

that way you can test the textarea and the label separately

karlmikko avatar Aug 09 '14 04:08 karlmikko

Having a bit of difficulty seeing this, could you give a usage example for those? e.g. <Label message="not enough characters" status="bad" />?

brigand avatar Aug 09 '14 04:08 brigand

It is more moving renderRemaining to a new component and passing it the bits it needs

karlmikko avatar Aug 09 '14 04:08 karlmikko

working on jsbin

karlmikko avatar Aug 09 '14 04:08 karlmikko

Ah okay... yeah that's a somewhat lazy pattern I've gotten into... I'll try not to do that.

brigand avatar Aug 09 '14 04:08 brigand

http://jsbin.com/xewayoti/1/edit updated

karlmikko avatar Aug 09 '14 05:08 karlmikko

updated jsbin

karlmikko avatar Aug 09 '14 05:08 karlmikko

Awesome! I committed your changes (there was a syntax error in the jsbin for some reason, so just fixed that).

brigand avatar Aug 09 '14 05:08 brigand

Thinking on this more - do we need this to have a min? as it would reduce complexity of the component and still be size limited.

I was just wondering if it would be easier to comprehend as a reader new to the concepts.

karlmikko avatar Aug 12 '14 11:08 karlmikko