Skip to content
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

WIP - Fabric ScrollView fixes #11

Draft
wants to merge 17 commits into
base: shwanton/fabric-core-fixes
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
006bb78
[fabric] Add support for native vertical inversion to enhanced scroll…
Sep 7, 2023
dfdfd54
[fabric] Add inverted property to scroll view
Sep 7, 2023
4849f8b
[fabric] Propagate component inverted property to native scroll view
Sep 7, 2023
b3cf76e
[fabric] Add RCTScrollContentComponentView Fabric Native View
shwanton Sep 26, 2023
a3ef096
[fabric] ScrollContentView should be mounted as document view of Scro…
shwanton Oct 13, 2023
9201887
[fabric] Subscribe to and dispatch NSScrollView scrolling notifications
Nov 9, 2023
10879f6
[fabric] Show autohiding scrollbars by default for RCTScrollViewCompo…
Nov 9, 2023
10da47b
[fabric] Support contentInset on RCTScrollViewComponentView
Nov 9, 2023
9282145
[fabric] Implement setContentOffset on Fabric scroll view to support …
Nov 10, 2023
c7e9757
[fabric] Implement zoomToRect on Fabric scroll view
Nov 10, 2023
f3a0906
[fabric] Implement flashScrollIndicators on Fabric scroll view
Nov 10, 2023
4080512
[fabric] Add content centering and offset bounds check to fabric scro…
Nov 14, 2023
7b7192e
[fabric] Adding a getter to layoutable shadow node to mark vertical a…
Mar 14, 2024
35c146f
[fabric] Support flipped views in relative layout metrics evaluation
Mar 14, 2024
600f994
[fabric] Add a custom shadow node to ScrollContentComponentView
Mar 15, 2024
460ac95
[fabric] Add view flipping propagation to ScrollView/ScrollContentVie…
Mar 15, 2024
409de4c
[fabric] Fix View content clipping to bounds toggling randomly on mount
Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[fabric] Implement flashScrollIndicators on Fabric scroll view
Summary:
This diff adds the flashScrollIndicators method to the `RCTEnhancedScrollView` used by `RCTScrollViewComponentView` in Fabric.

This method is used by the command with the same name to enable the flashing of the scroll bars from the JS side.

Test Plan:
Run Zeratul with Fabric enabled and with a custom VirtualizedList.js implementation that adds the following code to `_onContentSizeChange`:
```
this.getScrollResponder().flashScrollIndicators();
```

This should flash the scroll bars every time the content size of the scroll view changes. Meaning adding a message to a thread should flash the scroll bars using the `flashScrollIndicators` command.

 https://pxl.cl/3MVZ1

Reviewers: shawndempsey, #rn-desktop

Reviewed By: shawndempsey

Differential Revision: https://phabricator.intern.facebook.com/D51222019
  • Loading branch information
Nick Lefever authored and shwanton committed May 2, 2024
commit f3a0906408b0779c8b7628ec1e9af2b726a3791d
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ NS_ASSUME_NONNULL_BEGIN

- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;
- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated;
- (void)flashScrollIndicators;
#endif // macOS]

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated
{
[self magnifyToFitRect:rect];
}

- (void)flashScrollIndicators
{
[self flashScrollers];
}
#endif // macOS]

#if !TARGET_OS_OSX // [macOS]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,7 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args

- (void)flashScrollIndicators
{
#if !TARGET_OS_OSX // [macOS]
[_scrollView flashScrollIndicators];
#endif // [macOS]
[(RCTEnhancedScrollView *)_scrollView flashScrollIndicators]; // [macOS]
}

- (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated
Expand Down