케이스 ce-0056-contenteditable-with-placeholder-ko · 시나리오 scenario-placeholder-behavior

contenteditable이 포커스를 받을 때 플레이스홀더 텍스트가 사라짐

OS: macOS Ubuntu 22.04 기기: Desktop or Laptop Any 브라우저: Safari 120.0 키보드: US 초안
placeholderfocussafari

현상

CSS ::before 또는 ::after 의사 요소를 사용하여 contenteditable 영역에 대한 플레이스홀더 텍스트를 만들 때 요소가 포커스를 받으면 콘텐츠가 비어 있어도 플레이스홀더가 즉시 사라집니다. 이는 <input><textarea> 동작과 다릅니다.

재현 예시

  1. 플레이스홀더 스타일이 있는 contenteditable div를 만듭니다:
    [contenteditable]:empty::before {
      content: "Type here...";
      color: #999;
    }
  2. contenteditable에 포커스합니다.
  3. 플레이스홀더가 사라지는지 관찰합니다.

관찰된 동작

  • macOS의 Safari에서 콘텐츠가 비어 있어도 포커스 시 플레이스홀더가 사라집니다.
  • 이는 텍스트가 입력될 때까지 플레이스홀더가 유지되는 표준 입력 요소와 다릅니다.
  • 동작이 사용자 기대와 일관되지 않습니다.

예상 동작

  • 콘텐츠가 비어 있을 때 포커스 시 플레이스홀더가 유지되어야 합니다.
  • 실제로 콘텐츠가 입력될 때만 사라져야 합니다.
  • 동작이 표준 입력 요소와 일치해야 합니다.

이 시나리오의 변형

케이스 OS 브라우저 상태
ce-0056-contenteditable-with-placeholder-ko macOS Ubuntu 22.04 Safari 120.0 초안
ce-0568-chrome-android-placeholder-korean-ime-ko Android 14.0 Chrome 131.0 확인됨

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: macOS Ubuntu 22.04
Device: Desktop or Laptop Any
Browser: Safari 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.