-
Notifications
You must be signed in to change notification settings - Fork 74
feat: Web compatibility #98
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,7 @@ | |
| "react-native-gesture-handler": "2.3.0", | ||
| "react-native-reanimated": "^3.2.0", | ||
| "release-it": "^14.2.2", | ||
| "typescript": "^4.1.3" | ||
| "typescript": "^4.9.5" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. main was failing for |
||
| }, | ||
| "peerDependencies": { | ||
| "react": "*", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,9 +76,19 @@ const defaultRenderImage = ({ | |
| }: RenderItemInfo<any>) => { | ||
| return ( | ||
| <Image | ||
| onLoad={(e) => { | ||
| const { height: h, width: w } = e.nativeEvent.source; | ||
| setImageDimensions({ height: h, width: w }); | ||
| onLoad={() => { | ||
| Image.getSize( | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nativeEvent.source doesn't work on web. |
||
| item, | ||
| (width, height) => { | ||
| setImageDimensions({ | ||
| height, | ||
| width, | ||
| }); | ||
| }, | ||
| (err) => { | ||
| console.log('Image.getSize error', err); | ||
| } | ||
| ); | ||
| }} | ||
| source={{ uri: item }} | ||
| resizeMode="contain" | ||
|
|
@@ -786,7 +796,7 @@ const ResizableImage = React.memo( | |
| .onEnd(({ x, y, numberOfPointers }) => { | ||
| 'worklet'; | ||
| if (!isActive.value) return; | ||
| if (numberOfPointers !== 1) return; | ||
| if (numberOfPointers > 1) return; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On web (with mouse), numberOfPointers is 0 (if I understand correctly, this was preventing two finger touches from triggering double clicks, so > 1 should have the same effect) |
||
| if (onTap && interruptedScroll.value) { | ||
| interruptedScroll.value = false; | ||
| if (onTap) { | ||
|
|
||
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.
expo-image (at least this version) gives a bunch of errors on web, also the error in the main library was from
defaultRenderImage, so switched to using that in the example