myxvisual / react-uwp

📱⌨ React Components that Implement Microsoft's UWP Design & Fluent Design.
https://react-uwp.com
MIT License
1.18k stars 78 forks source link

Questions on TextBox when intended for a textarea of multiple lines. #66

Open Alive24 opened 5 years ago

Alive24 commented 5 years ago

Problem description

On the readme of TextBox it says "It's typically used to capture a single line of text, but can be configured to capture multiple lines of text", but I failed to find informative instructions on how to achieve it. After reading the render method of this component in source code, I find that it renders a tag anyway while I was hinted (not 100% sure) that input tag would always be only one line.

So my question is: How do I properly make a multiple line textarea in React-uwp?

PS. I attempted to inherit the component but it didn't work for me as I get message ("Subesequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'symbol[]') from tslint when I tried to incorporate the following code.

Link to minimal working code that reproduces the issue

TextBox/index.js

    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
            t[p[i]] = s[p[i]];
    return t;
};

Versions