cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmitcha1
Frequent Visitor

Scrolling in gallery cuts off before end of list (canvas app)

Issue: One screen on my canvas app has a section for a gallery. In the live app, in some browsers, I cannot scroll all the way through the full gallery. Scrolling stops short of the final records, cutting off the record so it cannot be read.

 

Goal: I would like to build a gallery that fits into a fixed set of dimensions on a screen and that consistently scrolls through to the bottom of all gallery records that are related to the current main record on the screen.

 

Background: This app is not built responsively. It is only used on laptops and monitors, so resizing for screens is not a need. There are many other galleries in the app, but only this one has a scrolling issue. This is the only gallery where the individual record has stacked items (a title, a text field with varying contents under that, and a time stamp under that).

 

The text field contains notes, so it can be a range of sizes.

 

Attempts:

- A flexible gallery. I created a flexible gallery with overflow on for scrolling. The template height is computed using a field in each record that sums the three stacked items. The text field is set to autoheight. I tried with flexible height on and off. With flexible height off, this works great in studio on all computers and in the browser in some computers. And sometimes, the scrolling stops before the end of the gallery.

- A container with a flexible gallery inside of it. 

- A full container solution with the gallery itself inside of a container, then a vertical container within the gallery, with each of the three fields in their own stacked container.

 

I've tried multiple variations of setting the container and gallery heights as fixed and calculated, layoutminheight (same mix), outer container scrolling on, etc. No combination I've tried so far allows me to put a gallery within a defined set of dimensions on a page, populate the gallery with records where one field is of varying heights, and scroll through that gallery all the way to the bottom.

 

The gallery items have a wide range of padding at the top, as well, which may be contributing to the scrolling issue. Perhaps the gallery height is maxed out by the padding before all the records can be scrolled through. 

 

The workaround so far for people whose browsers cut of scrolling is for them to reset their screen size lower (e.g., to 75%), then the whole gallery can be scrolled through. This is not an excellent long-time solution for a basic web functionality.

 

I've found three other posts here so far where people are having the same problem, but none have a solution in the thread.

 

I've gone back to all of the videos and Office documentation to rebuild the different solutions from scratch, but each time, scrolling works in all browsers in studio, but cuts off before the end of the list in some computers' browsers and not others'.

 

I believe it would be easier to start from scratch again rather than troubleshoot any of the multiple iterations of the galleries, but I am open to a Plan Z.

 

If anyone has found a way to consistently scroll to the bottom of gallery with stacked fields per record (rather than a tabular layout), autoheight on for one of the fields, and a defined height for the space the gallery sits in, your insights would be very welcome.

1 ACCEPTED SOLUTION

Accepted Solutions
dmitcha1
Frequent Visitor

Here is the solution I came up with that enables a full scroll to the bottom of the gallery if you have "Scale to Fit" enabled on your app. (This doesn't allow for Autoheight fields, unfortunately, but at least you can scroll through the whole list).

 

To include a gallery in a section with a defined height and have the gallery successfully scroll through to the last record:

1) Insert a vertical container, and set it to the height and width of the section that will contain your gallery.

2) Insert a second vertical container within the first. Set it to the same height and width, and set the height to "flexible."

3) Insert a vertical gallery into the second container. Do not use a flexible gallery; even if you turn flexible height off, it will have enormous pad and not scroll fully through your items. Use a regular, vertical gallery.

4) Add the desired fields to your gallery. I used relative Xs and Ys but fixed heights for everything. I removed all the padding from any added field.

5) For the field you wish to have dynamically sized, choose a field height that accommodates the median height for that field and set overflow to Scroll. The really small records will have unsightly gaps, but it's worth it to finally see all records when you scroll.

 

This solves the scrolling issue, but there's still extra pad because you have to set a fixed height for a field with variable contents. Unfortunately, excess pad is inevitable if your app is set to "Scale to Fit" (mine was built before responsive containers existed, and it's very complex to manually convert to responsive design.)

 

View solution in original post

1 REPLY 1
dmitcha1
Frequent Visitor

Here is the solution I came up with that enables a full scroll to the bottom of the gallery if you have "Scale to Fit" enabled on your app. (This doesn't allow for Autoheight fields, unfortunately, but at least you can scroll through the whole list).

 

To include a gallery in a section with a defined height and have the gallery successfully scroll through to the last record:

1) Insert a vertical container, and set it to the height and width of the section that will contain your gallery.

2) Insert a second vertical container within the first. Set it to the same height and width, and set the height to "flexible."

3) Insert a vertical gallery into the second container. Do not use a flexible gallery; even if you turn flexible height off, it will have enormous pad and not scroll fully through your items. Use a regular, vertical gallery.

4) Add the desired fields to your gallery. I used relative Xs and Ys but fixed heights for everything. I removed all the padding from any added field.

5) For the field you wish to have dynamically sized, choose a field height that accommodates the median height for that field and set overflow to Scroll. The really small records will have unsightly gaps, but it's worth it to finally see all records when you scroll.

 

This solves the scrolling issue, but there's still extra pad because you have to set a fixed height for a field with variable contents. Unfortunately, excess pad is inevitable if your app is set to "Scale to Fit" (mine was built before responsive containers existed, and it's very complex to manually convert to responsive design.)

 

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 (1,831)