designsystemsinternational/mechanic

Add textArea input type

Opened this issue · 7 comments

This would be nice to be able to input and edit longer text more easily.

i am currently working with longer text options for some kind of generator and i am pretty curious if it is possible to implement some kind of automated line break if it hits some kind of maxWidth value or something @bravomartin

Hi @kunaumadein I understand there are two part to your question.

  1. we don't have a textarea input yet but we plan to add it soon.
  2. If I understand correctly, you're using svg and you're having issues with line wrapping? This is a limitation of SVG, really. We recently implemented the ability to use HTML instead of SVG. It could help you with the line wrap.

Hello @bravomartin
The ability to use HTML do you refer to the HTML canvas engine or a different kind of method or just plain HTML in combination with SVG?

I mean using html dom elements instead of SVG. so instead of returning <svg>{stuff}</svg> you could return <div>{stuff}</div> and it would work. this gives you the ability to use regular html/css styling, including max-width, text-wrap, etc.

Ok I am gonna check it out thanks!

Is a textarea input still planeed? I could send a PR implementing this if you agree. Thanks!

Hi @nickdima! That would be great!