Open rdewolff opened 2 years ago
@rdewolff I'll check this out ASAP
In the broken web app, where are events placed in the screen? For example an event in the central week, the week before and the week after. Could you show a screenshot/gif with those?
I haven't added meets on the first test I did. Let me give it a try and get back to u
@rdewolff I was able to reproduce it and display some dummy events, so don't worry:
Aaah great, you got a setup working 🥳
I just tried to display some events in the grid but did not get it working. Did you already do some fixes @pdpino to get your event displayed?
TL;DR: I fixed some things, but is still not working 100%, probably due to an upstream bug from react-native-web VirtualizedList
. Demo:
(btw the cursor is not moving because I was scrolling with the wheel)
Details:
There are multiple things in the initial example that were wrong:
startHour
is not performed (i.e. you cannot call scrollTo()
for the ScrollView
ref)What I did:
ScrollView
's height to height: '100vh'
(100 viewport's height, web only)VirtualizedList
and FlatList
have shown issues in react-native-web (for example see a list of issues here: https://github.com/necolas/react-native-web/pull/2241#issuecomment-1055824946)
initialScrollIndex
behavior was fixed --> the week starts pointing to today (see gif)
yarn add react-native-web@0.0.0-b2a3e86d
, see preview here: https://github.com/necolas/react-native-web/pull/2248) onMomentumScrollEnd
event from the horizontal VirtualizedList
is not being triggeredVirtualizedList
example, and I think this is an issue from react-native-web (I can provide more details for a small repro)4.2 is probably a dealbreaker for most apps. We should corroborate if it is a bug from react-native-web; hopefully they will have a workaround soon
Did you already do some fixes to get your event displayed?
@rdewolff tbh I don't remember if I had already made a small fix for that demo :laughing:
I made a draft PR with the fixes so far
Concerning 4.2, is there a way to use an alternative to onMomentumScrollEnd
?
The options I can think of are not good, e.g.
onScroll
event
onEndReached
event
onStartReached
--> would not work on the other side (right or left)So our best bet might be to wait for react-native-web
to support onMomentumScrollEnd
.
Maybe this comment is related to our issue: https://github.com/expo/expo/issues/16822#issuecomment-1099169366 ?
How can we get this issue moving forward?
How can we get this issue moving forward?
PR #201 will fix up to 4.1.
As to 4.2, I'm afraid without scroll events in web there is not much more we can do. I see a lot of attention in rn-web, (e.g. https://github.com/necolas/react-native-web/issues/2249, https://github.com/necolas/react-native-web/pull/2241), hopefully they will have a fix soon
On the side, I'm implementing some performance improvements, and that might include migrating to recycler-list-view, which should support rn-web scroll events. Although these changes are taking me a bit longer. (I'll probably open a separate issue regarding this soon).
UPDATE: See #209, we are not migrating to another library for now.
PR #201 was merged 🥳 https://github.com/necolas/react-native-web/issues/2249 is still open 👀 https://github.com/necolas/react-native-web/pull/2241 is done ✅
@rdewolff necolas (rn-web 's author) commented:
those of you who need these events will need to implement and submit PRs for. I do not plan to work on adding these features myself.
I cannot work on that right now.
To recap, I think the options are:
or wait for other libraries, e.g.:
with 2 or 3 we could try to make the change only for web (instead of web and mobile), if that's simpler. In any case, have in mind is a big refactor and may cause conflicts with other stuff (animations, etc)
The current workaround is to add navigation button to navigate to previous or next week.
Just found this https://github.com/Flipkart/recyclerlistview Is it something we could use @pdpino ?
Sorry for the late reply.
@rdewolff recyclerlistview does not support bidirectional infinite scrolling: https://github.com/Flipkart/recyclerlistview/pull/647#issuecomment-1258695663
They implemented a fix for VirtualizedList, and is published in a fork of react-native: https://github.com/facebook/react-native/pull/29466#issuecomment-1255383709. Using this might fix the problem?
The library is not working when compiling a react-native project for macOS (Catalyst for example). It's not working either when using react-native-web version.
The following elements are not working:
Please find a video illustrating the first examples:
Steps to reproduce:
react-native-week-view
package<WeekView... />
component on a pageNotes