-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DTRA] Maryia/feat: vertical scroll behavior updates for isVerticalScrollEnabled functionality when disabled #1628
[DTRA] Maryia/feat: vertical scroll behavior updates for isVerticalScrollEnabled functionality when disabled #1628
Conversation
src/store/ChartAdapterStore.ts
Outdated
top: this.touchValues.deltaYTotal, | ||
behavior: 'smooth', | ||
}); | ||
this.scrollChartParentOnTouchTimer = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside of timeout timer can be cleared only by undefined assignment or this will work too:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want to clear the timer inside it because it has already been executed, it won't be needed.
the purpose of this.scrollChartParentOnTouchTimer = undefined;
(id removal) is to ensure that we initiate the next setTimeout
execution only after the current one has finished execution (not let the if condition be satisfied).
src/store/ChartAdapterStore.ts
Outdated
top: screenY - Number(this.touchValues.yOnTouchEnd ?? this.touchValues.y), | ||
const isForcedScrollArea = x < nonScrollableAreaWidth; | ||
const shouldForceMaxScroll = | ||
Math.abs(Number(this.touchValues.deltaYTotal)) > 10 && e.type === 'touchend'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes we get touchcancel
instead of touchend
, do we need to handle this case too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we don't need to do that. also, we won't get touchcancel
here ever because we don't trigger onTouch
action for this event type.
648c1bc
to
f37f9ec
Compare
src/store/ChartAdapterStore.ts
Outdated
Math.abs(Number(this.touchValues.deltaYTotal)) > 10 && e.type === 'touchend'; | ||
const stopChartPagination = () => { | ||
// calling _scrollAnimationController.stop() in flutter-chart, value 1 doesn't affect the scale: | ||
this.flutterChart?.app.scale(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preview Link: https://pr-1628-dtra-flutt.smartcharts-preview.pages.dev
|
🎉 This PR is included in version 2.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Dtrader V2 changes for
isVerticalScrollEnabled
===false
:With
isVerticalScrollEnabled={false}
, the chart scroll behavior will be now as follows:toggleXScrollBlock
method that has been added to theflutter-chart
controller.Deriv-app PR: deriv-com/deriv-app#16434
Flutter-chart PR: deriv-com/flutter-chart#327