bug(cdk/overlay): scroll blocking overlay persists when documentElement shrinks to the point it is not needed
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### Description
This came up for an app that had a button to launch a full screen dialog. When you click the button it essentially hides the main app and launches the dialog. However, at the time the dialog launches, the content is still showing so it calculates the height based on documentElement here (https://github.com/angular/components/blob/main/src/cdk/overlay/scroll/block-scroll-strategy.ts#L111) and determines the scroll blocking class is needed. The main content then disappears making the blocking class unnecessary, but it never updates after the initial calculation. This results in a disabled scrollbar being shown in the app.
As a workaround, apps in this situation should ensure that they remove content they want to hide & wait for that change to be rendered in the DOM before launching the dialog.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans src/cdk/overlay/scroll/block-scroll-strategy.ts vers la ligne 111, où la taille de documentElement est utilisée pour décider si le défilement doit être bloqué. Reproduisez la séquence en lançant une boîte de dialogue en plein écran alors que le contenu principal est encore présent, puis masquez ce contenu. C’est terminé lorsque l’état de blocage inutile n’est plus conservé et que la barre de défilement désactivée ne s’affiche pas.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100