Caret hidden behind the editor toolbar on iOS when editable root is enabled

Đang mở
#918 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đá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
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
ios, javascript
Lĩnh vực
frontend, mobile

Hướng nghiên cứu

Start with the editableRoot handling and the FIXME in EditorViewController.swift, then reproduce the caret overlap in the iOS demo using the steps in the issue. The issue describes two possible approaches, but leaves the choice open and spans native WebView behavior and web-side scrolling. Done means the caret stays above the toolbar when the keyboard covers the tapped paragraph.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[Type] Bug
Description

This is a latent bug: it doesn't affect users today, because #821 patches the editableRoot opt-in out of the Paragraph, Heading and List Item blocks. It blocks removing that patch.

With the opt-in enabled, tapping a block that the keyboard will cover scrolls the caret to just above the web view's bottom edge, behind GBK's bottom toolbar. I expect the caret to land above the toolbar, as it does with the opt-in patched out.

WebKit's reveal logic (-[WKWebView _zoomToFocusRect:…]) places the caret 8pt above the visible edge when the focused element is taller than the visible area. With editable root, the focused element is the whole writing-flow wrapper. GBK's web view ends at the keyboard, and its toolbar is a fixed web element, so WebKit can't see it. scroll-padding-bottom doesn't affect this native reveal.

Setting obscuredContentInsets.bottom (iOS 26+) moves the caret above the toolbar. But it also shrinks the layout viewport, so the fixed toolbar moves up with it and doesn't paint inside the inset.

Possible fixes: a native toolbar outside the web view (see the FIXME in EditorViewController.swift), or scrolling the caret clear of the toolbar from the web side.

Step-by-step reproduction instructions
  1. Revert the editableRootKey removal in patches/@wordpress+block-library+12.1.0.patch and run make build.
  2. In the iOS demo app, open the standalone editor and add eight two-line paragraphs.
  3. Swipe down to hide the keyboard.
  4. Tap a paragraph in the lower third of the screen.
  5. The tapped line and caret sit behind the toolbar above the keyboard.
Screenshots, screen recording, code snippet

No response

Environment info

GutenbergKit trunk (0.20.0), iPhone 18 Pro simulator on iOS 27.2.

Please confirm that you have searched existing issues in the repo.
  • Yes
Ngôn ngữ chính
JavaScript
Star
29
Fork
6
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wordpress-mobile/GutenbergKit

Tất cả issue của wordpress-mobile/GutenbergKit

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.