Comments (7)
I think this fixes the scroll event, but I haven't had the time to examine it thoroughly enough to make a pull request.
ScrollController.js:1663
// When scroll-offset has changed, emit scroll-start event
if (this._scrollOffsetCache !== scrollOffset) {
if (!this._scroll.isScrolling) {
this._scroll.isScrolling = true;
this._eventOutput.emit('scrollstart', eventData);
} else {
this._eventOutput.emit('scroll', eventData);
}
}
from famous-flex.
Hello Torsten, glad to hear you like the component!
Your suggestion sounds like a great idea!
I think the code you suggest would work, but I think it would be better if the scroll
event is emitted after the layout has been recalculated (at the same time, scrollend
is emitted`. If you can make a pull request out of it, I'll add it to the codebase.
Cheers,
Hein
from famous-flex.
Sure, I'll give it a try and also move it to the end of the commit method!
from famous-flex.
Awesome!
from famous-flex.
Awesome Torsten!
I'm just reviewing the code and I'm going to make some changes it. I think it would be useful to always emit the 'pagechange' event, even when the pagination
is not enabled. Also, I'm moving the call to getFirstVisibleItem
to after the layout function (it may have changed after the layout has been executed.
I noticed that pagechange
is only executed when an actual visibleItem
exists. In my interpretation of such an event, it should also emit the event when a change from page A
to no page
is detected. In that case someone can write an event-handler and for instance clear the detail view when no current page exists.
from famous-flex.
I've pushed the changes. The pagechange
event is now fired whenever the visible content has changed. So also, when you for instance swap
the first item. Basically, whenever the renderable has changed, pagechange
is emitted. Also, on startup an event is emitted, when transitioning from no page
to page A
.
Let me know what you're thoughts are on this.
from famous-flex.
I agree with you regarding triggering the event when page changes from or to undefined. The idea to only check for page changes when the scrollview was paginated was mostly to avoid unnecessary checks, but it makes sense to not limit the event to paging views.
Thanks for implementing these events!
from famous-flex.
Related Issues (20)
- velocity limit HOT 10
- Scrollview is only partially shown (after blurring an input element, window scroll position isnt reset) HOT 9
- Pull to refresh on desktop HOT 3
- any plans to support https://github.com/Famous/engine/tree/v1.0.0? HOT 7
- Scrollview: scroll without animation HOT 3
- Invalid bower version HOT 2
- FlexScrollView - mousepad two finger scrolling doesn't work in paginated view
- LayoutController insert 0 not working HOT 6
- CollectionLayout last row just partial visible HOT 1
- WheelLayout (DatePicker) sometimes wrong number sequence HOT 7
- Possible Bug in CollectionLayout HOT 5
- Is mixed-mode really good(right) ? HOT 7
- What is the state of Famous-Flex? HOT 6
- Surface leakage issue because of Entity.register HOT 2
- Bug in DatePicker.Component.FullDay HOT 7
- SamsaraJS support
- Error: HOT 6
- Correction in documentation HOT 2
- Use famous-sizeconstraint with FlexScrollView
- Changes to LinkedListViewSequence does not get reflected in FlexScrollView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from famous-flex.