https://github.com/smnandre/ux-live-nested
Infinite scroll with nested components
https://github.com/smnandre/ux-live-nested
Last synced: 3 months ago
JSON representation
Infinite scroll with nested components
- Host: GitHub
- URL: https://github.com/smnandre/ux-live-nested
- Owner: smnandre
- Created: 2024-05-02T15:15:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T15:29:30.000Z (about 2 years ago)
- Last Synced: 2025-01-10T14:01:51.062Z (over 1 year ago)
- Language: PHP
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Infinite scroll - nested
(tricky) Solution concerning the infinite scroll with nested components.
Original issue: https://github.com/symfony/ux/issues/1816
---
## Solution
We must create the last fake ID **recursively**.
```twig
{% if page > 1 %}
{# πΌπΌ Apply the same trick recursively πΌπΌ #}
{# ALL previous pages #}
{% for _page in 1..(page - 1) %}
{# Fake page #}
{# Fake page LAST resut #}
{% endfor %}
{% endif %}
```
## Run locally
```
composer install
symfony serve
```