rx.set_clipboard from a backend event handler fails on Safari/iOS with NotAllowedError
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #6595 di @carlosabadia — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, python
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Python
- Stelle
- 29k
- Fork
- 1.8k
- Merge medio
- 3g 5h
- PR unite (30g)
- 182
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reflex-dev/reflex
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
reflex-dev/reflex#8026 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Kept env.py failure: the "move it aside" hint is dropped and a full traceback is logged when alembic.ini uses a relative script_locationForse già presa @MaiAditya l’ha presa 13 giorni fa. Apertabug release-train
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
reflex-dev/reflex#7856 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
0.9.12 changelog follow-ups: the #7132 "_get_was_touched" entry describes unreachable behaviour, #7115's hasattr/getattr change is undocumented, #7131's wordingForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertarelease-train
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
reflex-dev/reflex#7260 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ClientStateVar: a component that mounts while the value is non-default never re-renders on the push back to the defaultForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
reflex-dev/reflex#6823 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
reflex-dev/reflex#6436 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di reflex-dev/reflex
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
superlinked/sie#1033 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/ponymail-foal#365 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
NousResearch/hermes-labs-plugins#116 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
gcivil-nyu-org/team-3-fall26#192 ·
I maintainer di solito rispondono entro 1 giorno
-
[Study plan] Study sessions can be rescheduled to any length (e.g. 72 hours) with no length checkAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gcivil-nyu-org/team-2-fall26#159 ·
I maintainer di solito rispondono entro 1 giorno