callstack / callstack/react-native-paper

Add keepMounted flag to Modal/Dialog

Abierto
#4,267 0 comentarios 1 reacción 0 asignados Ver en GitHub
feature request
Lenguaje dominante
TypeScript
Estrellas
14.5k
Forks
2.2k
Merge medio
5 d 23 h
PR fusionados (30 d)
12

Descripción

**Is your feature request related to a problem? Please describe.**
Yes. It would be nice to persist the content sent to a modal/dialog even after it is closed to improve rendering performance.

**Describe the solution you'd like**
The default behavior of mounting the content when the modal/dialog is visible and unmounting it on close animation is great. However, I would like a way to keep the content mounted regardless if it is open. Two options could exist:
1. `after-first` - After opening for the first time, mount the content and keep keep it mounted for subsequent opens
2. `always` - Eagerly mount the content right away and again keep it mounted

Proposing new flag `mountingBehavior` on modal/dialog of type: `'open-only' | 'after-first' | 'always'` defaulted to `'open-only'`

**Describe alternatives you've considered**
I'm in the process of creating a custom dialog to accomplish this.

**Additional context**
[MUI](https://mui.com/material-ui/api/modal/#modal-prop-keepMounted) has a `keepMounted` flag for this.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.