[TIMOB-27303] Windows: Issue with TableView scrollend event (Windows 10 uwp apps)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-05-15T18:25:20.000+0000 |
Affected Version/s | Release 7.0.2, Release 8.0.2 |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Aminul Islam |
Assignee | Unknown |
Created | 2019-08-02T13:48:28.000+0000 |
Updated | 2020-05-15T18:25:26.000+0000 |
Description
Hello!
Scroll event attached in Ti.UI.createTableView. After scroll event-triggered then the user wants to refresh table view. While scrolling, the table view shows blank.
This is happening in Windows 10 app (UWP) but working fine in android/iOS
Teste project: TestUWP.zip
*Steps to reproduce:*
1. Import attached project.
2. Build with sdk 8.0.2.GA or 7.0.2.GA on Windows 10 uwp apps on Windows Desktop
3. Scroll the table view
4. It showing blank
Operating System
Name = Microsoft Windows 10 Pro
Version = 10.0.17134
Architecture = 32bit
# CPUs = 4
Memory = 17091956736
Node.js
Node.js Version = 8.9.1
npm Version = 5.5.1
Titanium CLI
CLI Version = 5.1.1
Titanium SDK
SDK Version = 8.0.2.GA
SDK Path = C:\ProgramData\Titanium\mobilesdk\win32\8.0.2.GA
Target Platform = windows
Thanks
Attachments
File | Date | Size |
---|---|---|
TestUWP.zip | 2019-08-02T13:44:17.000+0000 | 101637 |
So it turns out the reason why table view shows blank is because UI is too busy rendering the table view. We see there are multiple reasons there;
Updating
In theTableView.data
causes re-creating of _entire_ table view rowscrollend
event in [^TestUWP.zip] shows that you updateTableView.data
property with empty array, and the update with concatenated array like below:However, this cause _re-creation of entire table view row_ despite you only want to append new rows. Instead of doing this, following code would be much better because this does not re-create entire table view rows.
We see that Windows desktop TableView firesscrollend
is fired too often when you drag scroll bar on Windows desktopscrollend
too often when you drag scroll bar. This is because Windows UWP component actually fires the event too often and Titanium is only forwarding the event acoordingly:( FYI this does not happen when you click (not drag) scroll bar arrow button so I would think this is platform component behavior bug but TIMOB-27335 will be taking care of this to try to suppress this.Windows TableView is basically heavy weight UI component
WindowsTableView
andListView
is relatively heavy weight UI component. You might want to check out the https://github.com/appcelerator-modules/ti.xaml.listview - we have much more lightweight module to represent tables - in case you want to push lot more rows to the table.https://github.com/appcelerator/titanium_mobile_windows/pull/1422