cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidstone
Kudo Kingpin
Kudo Kingpin

A fix for autoheight issues in improved rendering mode

Given the performance issues caused in my app by Improved Rendering Mode, I set about a big UI overhaul.

 

In the process I've just discovered a fix for the unpredictable behaviour of autoheight on labels. First of all, the symptoms occur when you're using both autoheight=true and have a condition for visibility. I expect it's a matter of render timing - but regardless, the fix is to also make your autoheight conditional, instead of just true. The easiest way to do that is to use the same code as your 'visible' condition in your autoheight.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @davidstone,

The fix is not strictly related to the nested level, but we could never reproduce this issue with just one level deep. Can you confirm that your gallery is on the regular screen and not a part of the scrollable screen or card? If so then I would appreciate some instructions on how to reproduce this in a new app.

Thank you,

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

I love this idea, but PowerApps isn't allowing me to change the AutoHeight property of my labels? I can neither change the AutoHeight property to label.Visible or the code I use to toggle visibility, If(tog.Value=true,false,true). As soon as a change the property and switch away it reverts to either true or false.

dinusc
Microsoft
Microsoft

Please note that we've identified and fixed an issue with the autoheight label when it is nested 2 levels deep in a container that has "visibility" formulas. For example, a label that is added to a flexible height gallery, which is added to another flexible height gallery that has a formula assigned to its "Visible" property.  Following the normal release schedule, the fix should be publicly available on the week November 12th.

 

Sounds great! Will this effect labels just one level deep? In my case the issue you've described a fix for actually occurs within just a single gallery with conditional visibility on a label - no nesting required.

Hello @davidstone,

The fix is not strictly related to the nested level, but we could never reproduce this issue with just one level deep. Can you confirm that your gallery is on the regular screen and not a part of the scrollable screen or card? If so then I would appreciate some instructions on how to reproduce this in a new app.

Thank you,

davidstone
Kudo Kingpin
Kudo Kingpin

I've got another fix for this - since the previous fix hasn't worked consistently for me.

 

Instead of having conditional visibility on my label (which, whether directly causative or not, makes the symptom occur), I have a condition on the x position. So instead of hiding the field, I simply position it to a negative x value which is off screen. Same result, but now the field properly displays at the right height.

 

And with that, I have decided to finally switch to Improved Rendering!!

Hi @dinusc,

To re-create my issue:-

  • Ordinary gallery on a freh page
  • Connect to some data with a couple of text fields, one of them long but not rich (I'm using an SP list)
  • Place a button into a gallery row, and have it collect the ID of the current item when it is clicked
  • Set your templatesize to 0 (it will then grow in height to whatever contents are visible
  • Place a label connected to the longer text value, but position the label below your button
  • Change the visible property of the label to show only if the ID of the current item is in the collection you created
  • Set the autoheight to true on the label
  • Now run the app, or use Alt - the symptoms are the same either way
  • You should see that each gallery item is only as tall as the button, but when you click the button, that item should expand to reveal the newly visible label - however the label is only around 3 pixels tall

 

I don't know, but I would guess this is something to do with the timing of the height calculation vs when the conditional visibility is displayed? I further suspect this because in another app I was able to set the height property of a field to a context variable, then use a timer to alter the context variable, after which the correct autoheight was calculated after the visibility.

Some of those steps aren't strictly necessary, such as collecting the ID of the item clicked. I'm only doing that because in my app you can 'expand' multiple rows.

Maverick101
Advocate I
Advocate I

I tried this and a couple other suggestions, but what worked for me was this:

  1. Create new label outside of the gallery. 
    • Label settings:
      • text: (your gallery).selected.(your text field)
      • visibility is true, but make sure you select the label options on the left pane > reorder > send to back (to essentially hide this)
      • Auto height = true
  2. Now on the label you want to fix the auto height issue with, change the following:
    • Auto height = false
    • height = (the new label mentioned above).height

 

Murillo-Mariano
Frequent Visitor

It's working for me, i used the same formula of the visibility in autoheight and worked.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,145)