iframe being rendered strangely in the canvas view
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Tái hiện hành vi của iframe trong bản demo chính thức bằng một khối mã tùy chỉnh, sau đó so sánh chế độ xem canvas với modal View code và editor.getHtml(). Theo dõi vị trí canvas thay thế iframe bằng một div và di chuyển các thuộc tính của nó; hoàn thành khi canvas giữ nguyên bố cục của iframe và vẫn nhất quán với đầu ra của model.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
The issue described below can be reproduced on the official demo at https://grapesjs.com/demo.html
When I try to add an iframe in a custom code block, the view tends to replace the iframe by a div, which breaks the layout of the iframe. However, the model seems to have the correct iframe since it is shown correctly in the view code modal, or by using editor.getHtml().
For example, if I add this iframe which is an embed YouTube video:
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?si=m6l8dvLYog_PS9a4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
This is what the canvas view will use, parts of the iframe attributes are now on a parent div:
<div data-gjs-highlightable="true" id="i73h" data-gjs-type="custom-code" draggable="true">
<div id="i5xd" data-gjs-type="video" draggable="true" allowfullscreen="" width="560" height="315" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?si=m6l8dvLYog_PS9a4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" class="gjs-hovered">
<iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?" frameborder="0" allowfullscreen="true" class="gjs-no-pointer" style="height: 100%; width: 100%;"></iframe>
</div>
</div>
- Ngôn ngữ chính
- TypeScript
- Star
- 81
- Fork
- 47
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 GrapesJS/components-custom-code
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
GrapesJS/components-custom-code#36 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
GrapesJS/components-custom-code#35 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Tất cả issue của GrapesJS/components-custom-code
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
TanStack/tanstack.com#1293 ·