bleeding-edge-sample-app
bleeding-edge-sample-app copied to clipboard
Restricted Textbox Component
So... this component is weird. We probably at least want to improve the styles.
Here's an example of it in jsbin.
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
Having a bit of difficulty seeing this, could you give a usage example for those? e.g. <Label message="not enough characters" status="bad" />
?
It is more moving renderRemaining to a new component and passing it the bits it needs
working on jsbin
Ah okay... yeah that's a somewhat lazy pattern I've gotten into... I'll try not to do that.
http://jsbin.com/xewayoti/1/edit updated
updated jsbin
Awesome! I committed your changes (there was a syntax error in the jsbin for some reason, so just fixed that).
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.