nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
215 stars 80 forks source link

[MDTextView][Android] Setting height of the component doesn't work #431

Closed cloudhx closed 1 year ago

cloudhx commented 1 year ago

Thanks for this great package! We're working on Android and trying to replace the NS ones with the material ones as much as possible. They all work as expected but with one minor issue on MDTextView. We set NS TextView with a height to mimic the Textarea in the web. This seems not work for MDTextView. No matter how I set the height via css or property, it always show one line height when empty.

<MDTextView #incidentComment class="incident-comment" height="300" variant="outline" placeholderColor="#9196A1"
            hint="Comment..." returnKeyType="next" (textChange)="onIncidentCommentChange($event)">
</MDTextView>

I would like to know if I'm doing something wrong or this component currently doesn't support the height.

Thank you.

farfromrefug commented 1 year ago

@cloudhx just to be clear your title say card but the actual issue is with mdtextview? Does it work on ios?

cloudhx commented 1 year ago

@farfromrefug Thanks for your quick reply. Sorry about the title, I've changed it to [MDTextView].

We haven't had an ios version yet, so cannot tell about that, I'll provide a few screenshots with both MDTextView and TextView and the code for your reference, thanks again for the support!

cloudhx commented 1 year ago

Here comes the screenshot, the red one is the NS TextView, from the code you can also see I set both to height=300, but only NS TextView works. It seems MDTextView does set a heigh of 300 (the space between two components), but not the visible part.

<GridLayout rows="auto, auto" class="incident-comment-container">
  <MDTextView #incidentComment height="300" class="incident-comment" variant="outline" placeholderColor="#9196A1" hint="Comment..." returnKeyType="next">
  </MDTextView>
  <TextView row="1" class="incident-comment" height="300" hint="Enter some text..." >
  </TextView>
</GridLayout>

Screenshot_20230131_111325_navigator

farfromrefug commented 1 year ago

@cloudhx thanks a lot for the details! I ll see what i can do as soon as possible

cloudhx commented 1 year ago

Sounds great! Thank you!

farfromrefug commented 1 year ago

@cloudhx you can update the packages it shoudl be fixed now!

cloudhx commented 1 year ago

@farfromrefug Thanks! I will do that today and get back to you.

cloudhx commented 1 year ago

@farfromrefug Sorry for the late reply, I have tested @nativescript-community/ui-material-textview@7.0.40 and it works like a charm, thank you so much for having the fix so quickly 💯 , it's really a great plugin for NativeScript!