Placeholder does not disappear after typing in Safari/WebKit

未关闭
#2,881 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
react, typescript
领域
frontend

调研方向

Start by locating PlaceholderExtension and the dynamically injected selector described in the issue, then reproduce the behavior in Safari or a WKWebView while comparing Chrome. Done means both the emptyDocument and default placeholders disappear immediately after typing, without requiring a focus change or refresh.

由索引模型根据 Issue 内容生成。

描述

What’s broken?

In Safari and WebKit based desktop applications, BlockNote's placeholders is not being cleared after text is started to be entered into a block or document. The document updates and the entered text persists correctly, but the placeholder is stilling being displayed inline beside the text until Safari or the application is refreshed. This affects both the emptyDocument placeholder and the default placeholder.
Image

What did you expect to happen?

The empty document and default placeholder should disappear immediately when starting to type into a block in Safari and WebKit-based desktop frameworks as happens in Chrome. Where the placeholder disappears immediately after the first character is entered.

Steps to reproduce
  1. Setup/Create a BlockNote editor.
  2. Open the editor in Safari or a WKWebView based desktop application (I am using Electrobun, Tauri is probably the same).
  3. Focus an empty document and type anything. Empty editor placeholder text remains beside the entered text if set.
  4. Press Enter to create another block and type text. Default placeholder text remains beside the entered text.
  5. Repeat in Chrome. Both placeholders disappear immediately after typing.
BlockNote version

0.51.4

Environment

Safari 27.0 (22625.1.20.11.3), macOS 27.0 (26A5368g), Electrobun 1.18.1 (WKWebView), React 19.1.0

Additional context

I got Codex to investigate the bug and it returned the following notes:

BlockNote 0.51.4 injects placeholder rules from PlaceholderExtension using a selector shaped like:

.placeholder-selector-... .bn-block-content[data-is-empty-and-focused]:has(.ProseMirror-trailingBreak:only-child)::after

In Chrome, typing removes the placeholder immediately (::after changes from the configured string to none, and the empty/focused decoration is removed). In Safari/WebKit, the editor contains and persists the entered text while the generated placeholder pseudo-content remains visible. Changing focus causes it to disappear.

This strongly suggests a WebKit style-invalidation issue involving the dynamically injected :has(...)::after rule, rather than an editor-state or persistence failure. The behavior was reproduced directly in Safari and in a native WKWebView, with Chrome used as the working control.

Contribution
  • I'd be interested in contributing a fix for this issue
Sponsor
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
主要语言
TypeScript
星标
10.2k
派生
772
平均合并
3 天 11 小时
30 天内合并 PR
17

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TypeCellOS/BlockNote 的其他 Issue

查看 TypeCellOS/BlockNote 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。