Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuever committed Jan 5, 2025
1 parent 91bc865 commit 2cf3e28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/scroller/src/react-native/Marshal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Marshal {
outerMostVerticalMarshal: Marshal;
outerMostHorizontalMarshal: Marshal;
removeClippedSubviews: boolean;
ref: MutableRefObject<ScrollView | View | undefined>;
ref: SpectrumScrollViewRef;
}) {
const {
id,
Expand Down
3 changes: 1 addition & 2 deletions ui/scroller/src/react-native/ScrollEventHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Marshal from './Marshal';
* ScrollEventHelper is bound to ScrollView, Every ScrollView will has its own
* `ScrollEventHelper`. then ScrollEventHelper will register to ScrollHelper,
* the ScrollEventHelper event is actually triggered by root ScrollHelper.
*
*/
class ScrollEventHelper {
private _disposer: Function;
Expand All @@ -28,7 +27,7 @@ class ScrollEventHelper {
private _onMomentumScrollBegin: SyntheticEventHandler | undefined;
private _onScrollToTop: SyntheticEventHandler | undefined;
private _subscriptions: ScrollEventHandlerSubscriptions;
private _onEndReached: (props: { distanceFromEnd: number }) => void;
private _onEndReached?: (props: { distanceFromEnd: number }) => void;
public marshal: Marshal;

constructor(props: {
Expand Down
10 changes: 10 additions & 0 deletions ui/scroller/src/react-native/ScrollHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ class ScrollHelper {
this._marshal.dimensions.updateScrollMetrics(this._scrollMetrics);
}

/**
*
* @returns
*
* To ensure the nested reverse direction ScrollView should be in considered..
* for example, vertical ScrollView include a horizontal ScrollView, when scrolling
* on vertical ScrollView, the horizontal ScrollView should be checked whether it
* is in viewport as well...
*
*/
prepareNested() {
const dimensions = this.getItemsDimensions();
if (!dimensions) return null;
Expand Down

0 comments on commit 2cf3e28

Please sign in to comment.