-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(ListView): sticky headers, sectioned data, optional search bar with auto-hide #10790
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
Conversation
…d diff version conflicts
…t/list-view-sticky-headers
|
View your CI Pipeline Execution ↗ for commit 49c361c
☁️ Nx Cloud last updated this comment at |
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.
Pull Request Overview
This PR adds sticky header and search functionality to the NativeScript ListView component. The implementation provides sectioned list support with sticky headers that remain visible while scrolling, and integrated search capabilities for both iOS and Android platforms.
- Adds sticky header support with customizable templates and heights for sectioned lists
- Implements native search functionality with UISearchController on iOS and SearchView on Android
- Introduces new properties:
stickyHeader,stickyHeaderTemplate,stickyHeaderHeight,stickyHeaderTopPadding,sectioned,showSearch,searchAutoHide
Reviewed Changes
Copilot reviewed 11 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/webpack5/src/configuration/base.ts | Fixed string quote consistency (double to single quotes) |
| packages/webpack5/package-lock.json | Changed devOptional to dev for numerous dependencies |
| packages/core/ui/list-view/list-view-common.ts | Added core properties and methods for sticky headers, sectioned data, and search functionality |
| packages/core/ui/list-view/index.ios.ts | Implemented iOS-specific sticky headers using UITableView sections and UISearchController |
| packages/core/ui/list-view/index.d.ts | Added TypeScript definitions for new ListView features and SearchEventData interface |
| packages/core/ui/list-view/index.android.ts | Implemented Android sticky headers with overlay positioning and native SearchView |
| packages/core/ui/index.ts | Exported SearchEventData type |
| packages/core/package.json | Bumped version to 9.0.0-alpha.13 |
| package-lock.json | Changed nativescript dependency from "*" to "alpha" |
| apps/toolbox/src/pages/* | Added demo pages showcasing sticky header and search functionality |
| apps/automated/src/ui/list-view/list-view-tests.ts | Added tests for sticky header functionality on iOS and Android |
Files not reviewed (1)
- packages/webpack5/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
packages/core/ui/list-view/index.ios.ts:1
- The magic number 50 appears twice with identical comments. Extract this as a named constant (e.g.,
DEFAULT_SEARCH_VIEW_HEIGHT = 50) and reuse it to eliminate duplication.
import { ItemEventData, SearchEventData, ItemsSource } from '.';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What is the current behavior?
It's possible to hook up custom delegate methods to handle sticky headers and auto-hiding search input but there were no declarative options to enable these features in stock ListView.
What is the new behavior?
ListViewsupport for sticky headers, sectioned data, and a built-in search bar, along with tests and a demo page to showcase it.ns-listview-sticky-headers.mp4
Various flavors can wire up to ease of use options on
stickyHeaderTemplateusage.Sectioned data may be used with the following format (
itemscan take on any shape desired):ListView Feature Additions
ListViewfor sticky headers (stickyHeader,stickyHeaderTemplate,stickyHeaderHeight,stickyHeaderTopPadding), sectioned lists (sectioned), and a built-in search bar (showSearch,searchAutoHide[ios only]).Search Event Support
searchChangeevent and its correspondingSearchEventDatatype, allowing consumers to react to search input changes inListView.Testing and Demo Improvements
list-view-tests.ts, verifying section rendering, header binding, explicit header height, and correct header updates.list-page-sticky.xmlandlist-page-sticky.ts) to showcase the new sticky header and sectioned list features shown above.