Uh oh!
There was an error while loading. Please reload this page.
fix transforms #280 - #460
Conversation
Tom Underhill (tom-un)
commented
Jun 19, 2020
Thank you! It looks like the change broke the FlatListExample in RNTester: I'll checkout your change locally to debug too. |
| */ | ||
| @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; | ||
| @property (nonatomic, assign) CATransform3D transform3D; |
There was a problem hiding this comment.
Should be inside the #if TARGET_OS_OSX block
I checked out your branch and debugged the test failure. It's crashing in |
Sergey (kurdin)
commented
Sep 30, 2020
Tom Underhill (@tom-un) any idea when this fix will be merged and available ? animations with transform rotation are broken right now |
Using `react-native-pager-view` on macOS and Windows causes errors. Solution is to use `PanResponder` for these platforms (same with web). Those platforms favors `.native.tsx` file over `.tsx` file which caused the errors. Solution is to use platform specific components for each. macOS fixes: Transform property is currently broken on `react-native-macos`. Temporary solution is to use `left` for indicator position. See: microsoft/react-native-macos#280 Windows fixes: `PlatformPressable` is not pressable on Windows (only the label), I'm not sure why, but adding `backgroundColor: 'transparent'` to it makes the whole tab pressable. ### Motivation `react-native-pager-view` does not support macOS and Windows. ### Test plan Run on `react-native-macos` and `react-native-windows` projects. Windows (initial):  Windows (swiping):  macOS (initial): <img width="489" alt="Screen Shot 2021-06-01 at 11 18 18 AM" src="https://user-images.githubusercontent.com/36528176/120262026-b671e800-c2cb-11eb-8337-c3bf792442ac.png"> macOS (swiping): <img width="397" alt="Screen Shot 2021-06-01 at 11 19 32 AM" src="https://user-images.githubusercontent.com/36528176/120262036-ba056f00-c2cb-11eb-82d5-5fa8135e454c.png"> macOS (swiping): if microsoft/react-native-macos#460 is merged <img width="391" alt="Screen Shot 2021-06-01 at 12 56 17 PM" src="https://user-images.githubusercontent.com/36528176/120268666-cfcd6100-c2d8-11eb-8ca7-97c260d07bee.png"> macOS (after swipe/swipe release): <img width="494" alt="Screen Shot 2021-06-01 at 11 20 11 AM" src="https://user-images.githubusercontent.com/36528176/120262033-b8d44200-c2cb-11eb-8c4b-8207ddac74b2.png"> Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Egor Voit (row248-hola)
commented
Nov 17, 2021
Tom Underhill (@tom-un) Hi! Any updates on this PR? It will be great when transforms would work properly |
Saad Najmi (Saadnajmi)
commented
Nov 17, 2021
Hello, Tom Underhill (@tom-un) no longer works in this repo actively. However, if I understand the description correctly, would this PR potentially also fix #767 ? |
Egor Voit (row248-hola)
commented
Nov 18, 2021
Saad Najmi (@Saadnajmi) |
Tom Underhill (@tom-un) Are we waiting on the following:
|
Saad Najmi (Saadnajmi)
commented
Feb 25, 2022
An FYI, I took over this PR in #1035 so if that lands, I'll close this one. |
Jason Kotzin (jdk)
commented
Feb 28, 2022
Saad Najmi (@Saadnajmi) Team tested #1035 and #1035 looks good. |
Using `react-native-pager-view` on macOS and Windows causes errors. Solution is to use `PanResponder` for these platforms (same with web). Those platforms favors `.native.tsx` file over `.tsx` file which caused the errors. Solution is to use platform specific components for each. macOS fixes: Transform property is currently broken on `react-native-macos`. Temporary solution is to use `left` for indicator position. See: microsoft/react-native-macos#280 Windows fixes: `PlatformPressable` is not pressable on Windows (only the label), I'm not sure why, but adding `backgroundColor: 'transparent'` to it makes the whole tab pressable. ### Motivation `react-native-pager-view` does not support macOS and Windows. ### Test plan Run on `react-native-macos` and `react-native-windows` projects. Windows (initial):  Windows (swiping):  macOS (initial): <img width="489" alt="Screen Shot 2021-06-01 at 11 18 18 AM" src="https://user-images.githubusercontent.com/36528176/120262026-b671e800-c2cb-11eb-8337-c3bf792442ac.png"> macOS (swiping): <img width="397" alt="Screen Shot 2021-06-01 at 11 19 32 AM" src="https://user-images.githubusercontent.com/36528176/120262036-ba056f00-c2cb-11eb-82d5-5fa8135e454c.png"> macOS (swiping): if microsoft/react-native-macos#460 is merged <img width="391" alt="Screen Shot 2021-06-01 at 12 56 17 PM" src="https://user-images.githubusercontent.com/36528176/120268666-cfcd6100-c2d8-11eb-8ca7-97c260d07bee.png"> macOS (after swipe/swipe release): <img width="494" alt="Screen Shot 2021-06-01 at 11 20 11 AM" src="https://user-images.githubusercontent.com/36528176/120262033-b8d44200-c2cb-11eb-8c4b-8207ddac74b2.png"> Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Using `react-native-pager-view` on macOS and Windows causes errors. Solution is to use `PanResponder` for these platforms (same with web). Those platforms favors `.native.tsx` file over `.tsx` file which caused the errors. Solution is to use platform specific components for each. macOS fixes: Transform property is currently broken on `react-native-macos`. Temporary solution is to use `left` for indicator position. See: microsoft/react-native-macos#280 Windows fixes: `PlatformPressable` is not pressable on Windows (only the label), I'm not sure why, but adding `backgroundColor: 'transparent'` to it makes the whole tab pressable. ### Motivation `react-native-pager-view` does not support macOS and Windows. ### Test plan Run on `react-native-macos` and `react-native-windows` projects. Windows (initial):  Windows (swiping):  macOS (initial): <img width="489" alt="Screen Shot 2021-06-01 at 11 18 18 AM" src="https://user-images.githubusercontent.com/36528176/120262026-b671e800-c2cb-11eb-8337-c3bf792442ac.png"> macOS (swiping): <img width="397" alt="Screen Shot 2021-06-01 at 11 19 32 AM" src="https://user-images.githubusercontent.com/36528176/120262036-ba056f00-c2cb-11eb-82d5-5fa8135e454c.png"> macOS (swiping): if microsoft/react-native-macos#460 is merged <img width="391" alt="Screen Shot 2021-06-01 at 12 56 17 PM" src="https://user-images.githubusercontent.com/36528176/120268666-cfcd6100-c2d8-11eb-8ca7-97c260d07bee.png"> macOS (after swipe/swipe release): <img width="494" alt="Screen Shot 2021-06-01 at 11 20 11 AM" src="https://user-images.githubusercontent.com/36528176/120262033-b8d44200-c2cb-11eb-8c4b-8207ddac74b2.png"> Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Using `react-native-pager-view` on macOS and Windows causes errors. Solution is to use `PanResponder` for these platforms (same with web). Those platforms favors `.native.tsx` file over `.tsx` file which caused the errors. Solution is to use platform specific components for each. macOS fixes: Transform property is currently broken on `react-native-macos`. Temporary solution is to use `left` for indicator position. See: microsoft/react-native-macos#280 Windows fixes: `PlatformPressable` is not pressable on Windows (only the label), I'm not sure why, but adding `backgroundColor: 'transparent'` to it makes the whole tab pressable. ### Motivation `react-native-pager-view` does not support macOS and Windows. ### Test plan Run on `react-native-macos` and `react-native-windows` projects. Windows (initial):  Windows (swiping):  macOS (initial): <img width="489" alt="Screen Shot 2021-06-01 at 11 18 18 AM" src="https://user-images.githubusercontent.com/36528176/120262026-b671e800-c2cb-11eb-8337-c3bf792442ac.png"> macOS (swiping): <img width="397" alt="Screen Shot 2021-06-01 at 11 19 32 AM" src="https://user-images.githubusercontent.com/36528176/120262036-ba056f00-c2cb-11eb-82d5-5fa8135e454c.png"> macOS (swiping): if microsoft/react-native-macos#460 is merged <img width="391" alt="Screen Shot 2021-06-01 at 12 56 17 PM" src="https://user-images.githubusercontent.com/36528176/120268666-cfcd6100-c2d8-11eb-8ca7-97c260d07bee.png"> macOS (after swipe/swipe release): <img width="494" alt="Screen Shot 2021-06-01 at 11 20 11 AM" src="https://user-images.githubusercontent.com/36528176/120262033-b8d44200-c2cb-11eb-8c4b-8207ddac74b2.png"> Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Please select one of the following
Summary
This fixes#280 by making the effective origin of transforms {0.5, 0.5} with some additional matrix magic. I haven't been able to figure out why the
anchorPointdefault on macOS/NSViewis{0, 0}rather than the iOS default{0.5, 0.5}(which matches theCALayerdocs: https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint)).This also fixes application of the transform so it works on initial render. The underlying issue was that we were setting
view.layer.transformdirectly (which is identified as undefined behavior in theNSViewdocs) and in practice doesn't work because the initial layer gets replaced after setting the initial values without copying the transform over to the new one, so it gets wiped out. The fix here is to savetransform3Don theRCTViewand apply it to the layer every timedisplayLayer:is called, along with all our existing custom layer rendering logic for border etc.Changelog
[macOS] [Fixed] - fix transforms #280
Test Plan
Microsoft Reviewers: Open in CodeFlow