Open bennewton999 opened 10 years ago
Setting the size of the surface to [undefined, undefined]
will make the size the height and width of the window, thus not allowing you to scroll. If you are not sure of the height of the content, you can set the size to [undefined, true]
which replicates the effect of height: auto
. Your example should be formatted as follows using a modifier that modifies both the fa-view and fa-surface and if you sequence 3 views that add up to a height taller than the window you should see the window scroll:
<fa-app>
<fa-scroll-view fa-pipe-from="eventHandler">
<fa-modifier fa-size="[undefined,undefined]">
<fa-view fa-index="0">
<fa-surface fa-pipe-to="eventHandler">misc html</fa-surface>
</fa-view>
<fa-view fa-index="1">
<fa-surface fa-pipe-to="eventHandler"> another misc html</fa-surface>
</fa-view>
<fa-view fa-index="2">
<fa-surface fa-pipe-to="eventHandler">yet another misc html</fa-surface>
</fa-view>
</fa-modifier>
</fa-scroll-view>
</fa-app>
I have tried setting the size of fa-modifier
to [undefined, true]
, but that did not make a difference. I have since worked around this by checking the height of the container div in the surface on scroll and assigning it to the fa-size
of te modifier. See here for the full code of the work around.
But it feels like a hack and I am not sure exactly what is wrong with my html now.
The full html code of the page is here showing the misc html that is included. :
I just posted a workaround I came up with on StackOverflow for the handling of true
sizing for surfaces in the scrollview. This isn't an issue with scrollview really, but an issue with true
size in F/A, It seems like a feature that didn't make it into Famous/Angular 0.5.0 but is available in Famo.us 0.3.0. @zackbrown do you know the status of true
sizing in F/A?
Was there any resolution to this? I'm getting pretty sick of fighting scrollview. Is there a way to just allow native scroll?
@5inline Sorry for your frustrations. Please create an issue and a codepen with your specific problem and I will try to help out.
Thanks,
Jordan
@5inline The famous scrollview is way more performant than native scroll. But it does have some issues. One other strategy is to use a GenericSync that maps touch and scroll events to one handler and roll your own view. Other things to remember are that true sizing only seems to work with the Scrollview when sequencing surfaces with the size explicitly set on each surface, or with the help of a Service like above. I really hope famo.us concentrates on bug fixes for the scrollview and 'true' sizing for an upcoming release.
I have the following code and the misc html in the fa-surface is larger than the fa-app container, yet I cannot scroll down. the scroll event is registering because it does move the element, but it immediately snaps back to the default position.
If I set the fa-size to a fixed height, the scroll works. However, I don't know the height of the misc html so I need to use undefined.
Am I missing something? Thanks.