nativescript-community / ui-collectionview

Allows you to easily add a collection view (grid list view) to your projects. Supports vertical and horizontal modes, templating, and more.
Apache License 2.0
59 stars 18 forks source link

add-vue3-support #53

Closed vallemar closed 1 year ago

vallemar commented 1 year ago

@farfromrefug I had to add this because vue detection seems to think it's a problem, I don't know why https://github.com/nativescript-community/ui-collectionview/pull/53/files#diff-1ad746efdafa03d38640e5d994fb7df938e003beacd00e8c81458f6c991433cfR257-R259

Update: do not merge, we are trying to solve the import for vue 3!

vallemar commented 1 year ago

@farfromrefug this PR is ready to review

vallemar commented 1 year ago

@farfromrefug Why is it possible that view is a GridLayout but nativeViewProtected is null on this line? https://github.com/nativescript-community/ui-collectionview/blob/master/src/collectionview/index.ios.ts#L675

I got an exception calling removeFromSuperview because nativeViewProtected is null. This happens when I'm scrolling through the list, but on the first display of the list it works fine

farfromrefug commented 1 year ago

@vallemar it means vue 3 is destroying the template nativeview where it should not. Think it is an issue on vue 3 side

vallemar commented 1 year ago

@vallemar it means vue 3 is destroying the template nativeview where it should not. Think it is an issue on vue 3 side

@rigor789 what can be happening here on ios? it's almost a clone of your listView https://github.com/nativescript-community/ui-collectionview/pull/53/files#diff-4252295cc5d9c750795c8997163e0efc0a46b0435ba4cb074d025375a5ed80d7R1

farfromrefug commented 1 year ago

@vallemar listview and collectionview are very different. The one you should compare to is the the vue2 impl of collectionview

farfromrefug commented 1 year ago

@vallemar all working now?

vallemar commented 1 year ago

@farfromrefug I'll try the updated branch now, thanks!

vallemar commented 1 year ago

@farfromrefug I think we can merge this. Now collectionView is working.

There are 3 problems left to solve, but I think it is not from the implementation of this PR.

  1. The recycling in DrawerMenu is broken, if you open an item and scroll down you will have another item open. This happens on Android and IOS
  2. Waterfall not working on IOS. I have opened this issue: Waterfall not working on IOS and vue2 #61 . Anyway, I think it's the behavior of Waterfall on ios and it has nothing to do with this implementation since it doesn't work in vue2 either.
  3. The ResizeCell (autoReloadItemOnLayout) has strange behavior on ios, sometimes it works and sometimes it doesn't. This is NOT happening in vue2.

We can merge this PR as it gives the basic collectionView functionality to vue3 and iterate over it in other PRs