rx.set_clipboard from a backend event handler fails on Safari/iOS with NotAllowedError
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #6595 de @carlosabadia — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, python
Línea de trabajo
Start with rx.set_clipboard and the backend @rx.event handling shown in the minimal reproduction, then reproduce the failure in Safari and iOS Safari. Trace where the clipboard write runs after the WebSocket round-trip; done means the same example copies successfully during the originating user gesture without breaking Chromium or Firefox.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On Safari (desktop) and iOS Safari, rx.set_clipboard(...) fails with
NotAllowedError: The request is not allowed by the user agent or the platform in the current context whenever it is returned from a backend
@rx.event handler (or otherwise reached after a WebSocket round-trip).
The same code works on Chromium and Firefox.
Root cause
Safari/WebKit requires navigator.clipboard.writeText() to be invoked
synchronously inside the user-activation window of the originating user
gesture (click/keydown). When rx.set_clipboard is returned from a backend
event handler, the actual writeText call runs from the socket.io message
handler, after the round-trip — so user activation is no longer in
effect and WebKit rejects the write.
Minimal repro
import reflex as rx
class State(rx.State):
secret: str = "hello"
@rx.event
def copy(self):
return rx.set_clipboard(self.secret)
def index():
return rx.button("Copy", on_click=State.copy)
app = rx.App()
app.add_page(index)
- Lenguaje dominante
- Python
- Estrellas
- 29k
- Forks
- 1.8k
- Merge medio
- 3 d 5 h
- PR fusionados (30 d)
- 182
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de reflex-dev/reflex
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
reflex-dev/reflex#8026 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Kept env.py failure: the "move it aside" hint is dropped and a full traceback is logged when alembic.ini uses a relative script_locationPosiblemente ocupada @MaiAditya la tomó hace 13 días. Abiertobug release-train
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
reflex-dev/reflex#7856 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
0.9.12 changelog follow-ups: the #7132 "_get_was_touched" entry describes unreachable behaviour, #7115's hasattr/getattr change is undocumented, #7131's wordingQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertorelease-train
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
reflex-dev/reflex#7260 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
ClientStateVar: a component that mounts while the value is non-default never re-renders on the push back to the defaultQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
reflex-dev/reflex#6823 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
reflex-dev/reflex#6436 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de reflex-dev/reflex
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
superlinked/sie#1033 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/ponymail-foal#365 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
NousResearch/hermes-labs-plugins#116 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
gcivil-nyu-org/team-3-fall26#192 ·
Los mantenedores suelen responder en 1 día
-
[Study plan] Study sessions can be rescheduled to any length (e.g. 72 hours) with no length checkAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
gcivil-nyu-org/team-2-fall26#159 ·
Los mantenedores suelen responder en 1 día