suid icon indicating copy to clipboard operation
suid copied to clipboard

TextField multiline property not working

Open paul-wery opened this issue 2 years ago • 1 comments

Using TextField multiline property is not working. Checking the DOM it seems tag has not been replaced by a

paul-wery avatar Aug 13 '22 18:08 paul-wery

There's workaround, you can replace it through InputProps { inputComponent: 'textarea' }

T3ch0o avatar Sep 02 '22 09:09 T3ch0o

This workaround doesn't work with suid/material 0.9.1and raises an error (TypeError: Cannot set property type of #<HTMLTextAreaElement> which has only a getter) at InputBase.jsx:310.

evlist avatar Jan 16 '23 20:01 evlist

Commenting lines 309 to 315 fixes this error but will probably have side effects !

evlist avatar Jan 16 '23 20:01 evlist

In fact the issue is that HTMLTextAreaElement has a type property (with "textarea" has a value) and this type property is read only while HTMLInputElement has a read/write type property.

A better patch is to leave these lines as they are and add the value "textarea" to the selectionTypes set (line 241):

const selectionTypes = new Set(["text", "textarea", "search", "password", "tel", "url"]);

evlist avatar Jan 16 '23 21:01 evlist

This is done guys (demo available at https://next.suid.io/components/text-field).

I will publish the new release in the next few days.

Closed via https://github.com/swordev/suid/commit/5a017a08d80e3638fff3fab41cf7f524543b067c.

juanrgm avatar Mar 08 '23 22:03 juanrgm