rx.set_clipboard from a backend event handler fails on Safari/iOS with NotAllowedError
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #6595 của @carlosabadia — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, python
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Python
- Star
- 29k
- Fork
- 1.8k
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 182
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của reflex-dev/reflex
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
reflex-dev/reflex#8026 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Kept env.py failure: the "move it aside" hint is dropped and a full traceback is logged when alembic.ini uses a relative script_locationCó thể đã có người làm @MaiAditya đã nhận 13 ngày trước. Đang mởbug release-train
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
reflex-dev/reflex#7856 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0.9.12 changelog follow-ups: the #7132 "_get_was_touched" entry describes unreachable behaviour, #7115's hasattr/getattr change is undocumented, #7131's wordingCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởrelease-train
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
reflex-dev/reflex#7260 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ClientStateVar: a component that mounts while the value is non-default never re-renders on the push back to the defaultCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
reflex-dev/reflex#6823 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
reflex-dev/reflex#6436 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của reflex-dev/reflex
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
superlinked/sie#1033 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/ponymail-foal#365 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
NousResearch/hermes-labs-plugins#116 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
gcivil-nyu-org/team-3-fall26#192 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Study plan] Study sessions can be rescheduled to any length (e.g. 72 hours) with no length checkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gcivil-nyu-org/team-2-fall26#159 ·
Maintainer thường phản hồi trong vòng 1 ngày