text-input
v1.0.1arrow_drop_downReturns an object with properties that are relevant for the TextInput’s textarea.
As the height of the textarea needs to be calculated valueLink can not be passed down to the textarea, but made available through this component.
Update hover & focus style for the speficied styleId.
TextInput component with great UX like autogrowing & handling states
Note on styling: Right now this component doen’t allow to change style after initialisation.
Note on resizing: If you fill a textarea only with spaces and the cursor reaches the right end it won’t break the line. This leads to unexpected behaviour for the automatic resizing.
This component was highly inspired by the great work from these guys
Generates the style-id & inject the focus & hover style.
Right after the component go injected into the DOM it should be resized.
Update the properties passed to the textarea and resize as with the new properties the height might have changed.
Remove a component’s associated styles whenever it gets removed from the DOM.
Prevent any newline (except allowNewLine is active) and pass the event to the onKeyDown property.
This is an optimization to avoid adding a newline char & removing it right away in the onUpdate callback.
Update the height and calls the provided change callback for onUpdate or valueLink.
In addition newline characters are replaced by spaces in the textarea value in case allowNewLine is set to false and newLine characters could be found.
Calculate the height and store the new height in the state to trigger a render.