ampproject / ampproject/amp-react-prototype
Lightbox, back button, and vetoable closing
- Vorherrschende Sprache
- JavaScript
- Sterne
- 36
- Forks
- 6
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Context: https://github.com/ampproject/amp-react-prototype/pull/8/files#diff-c554b9bd31408e663cff269f69a1c567R51
Issues:
1. Some component libraries take a stand that “back button” support has to be arranged by the caller outside the lightbox (controlled). But that causes numerous issues, including inability to make closing vetoable.
2. Back button support is HARD. Standard doesn’t exist.
Supporting back button involves the following considerations:
- Rollback of history pop for vetoable close is especially hard and requires in-depth knowledge of the stack to re-push the popped states. Some routers (e.g. ReactRouter) allow history-stack blocking for this. But it’s rare and usually buggy.
- A naive `history.pushState` can break a React router and can never be fully featured.
See also #43 on the discussion about controlled-vs-uncontrolled lightbox API.
Beitragsleitfaden
Rechercherichtung
Beginne mit den in PR #8 referenzierten Lightbox-Änderungen und lies die Diskussion in Issue #43. Untersuche, wie sich Browserverlauf, vetoable Schließvorgänge und Interaktionen mit React Router auf die vorgeschlagene kontrollierte oder unkontrollierte API auswirken. Als abgeschlossen gilt die Arbeit, wenn ein festgelegter und dokumentierter Ansatz für das Verhalten der Zurück-Schaltfläche und vetoable Schließvorgänge vorliegt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, react
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100