quill icon indicating copy to clipboard operation
quill copied to clipboard

Typing with Chinese IME Causes Text Overlapping with the Placeholder

Open dccxi opened this issue 10 months ago • 5 comments

Presumably a similar or the same issue as #4021 #4105

Steps for Reproduction

  1. Visit https://quilljs.com/playground/snow
  2. Switch to macOS's native Chinese IME
  3. Start typing in this box image

Expected behavior: Placeholder dismisses as I type

Actual behavior: Placeholder doesn't dismiss image

Platforms: Chrome 123.0.6312.87, macOS 14.2.1 Include browser, operating system and respective versions

Version: v2.0.0 Run Quill.version to find out

dccxi avatar Apr 17 '24 06:04 dccxi

You can use quillRef. root. dataset. placeholder='Placeholder text' to solve this problem

polaris-hike avatar Apr 30 '24 07:04 polaris-hike

A quick solution is to listen to compositionstart and clear the placeholder in the handler. Also restore the placeholder in compositionend.

luin avatar May 01 '24 03:05 luin

@dccxi You can use quill-react-commercial. Feature: When using IME and other input methods (such as Pinyin), placeholders can disappear in a timely manner.

quill-ime-pinyin-placehodler

ludejun avatar May 06 '24 02:05 ludejun

//解决新版quill系统键盘输入时,placeholder不消失的bug quill.root.addEventListener('input',()=>{ if (quill.root.innerText !== '\n' && quill.root.classList.contains('ql-blank')) { quill.root.classList.toggle('ql-blank', false); } });

zhong015 avatar Jun 13 '24 07:06 zhong015

quill.root.addEventListener('input', () => { if (quill.root.classList.contains('ql-blank')) { if (quill.root.innerText !== '\n' && quill.root.innerText !== '') { quill.root.classList.toggle('ql-blank', false); } } });

ahauzq avatar Aug 14 '24 03:08 ahauzq