medium-editor icon indicating copy to clipboard operation
medium-editor copied to clipboard

Need to click twice on empty element Chrome

Open kritollm opened this issue 4 years ago • 5 comments

Description

Need to click twice on empty element Chrome

Steps to reproduce

  1. Click on empty element
  2. Try to write
  3. Click on empty element and write

**Expected behavior:**Only need to click once to focus and write

Actual behavior: Need to click twice

Versions

  • medium-editor: 5.23.3
  • browser: Chrome 84.0.4147.105
  • OS: Windows

kritollm avatar Aug 06 '20 12:08 kritollm

Confirmed. Though for me it only happens if I click on the placeholder text. If I click on another part of the element it receives focus straight away.

shadow-light avatar Aug 08 '20 06:08 shadow-light

I'm fairly sure this is a bug with chrome as the contenteditable element remains focused and yet doesn't allow keyboard input. A way around this is to set hideOnClick: false in settings if you're ok with that option.

shadow-light avatar Aug 08 '20 07:08 shadow-light

Hi.

Thanks for a solution that worked. Seems like this only applies to Chrome, but there may be a way to fix it. I think I experienced the bug at the same time as Chrome got a black frame around focused elements.

The biggest problem is with copy/paste. The text is pasted into the element you are copying it from (if you don't click twice first). That problem was also solved with hideOnClick: false.

kritollm avatar Aug 10 '20 09:08 kritollm

I found a workaround by adding this style : .medium-editor-element:after{ content: ""; } So you can leave the option hideOnClick: true

patprache avatar Dec 29 '20 10:12 patprache

I found a workaround by adding this style : .medium-editor-element:after{ content: ""; } So you can leave the option hideOnClick: true

Perfect, thank you! Was really bugging me!

johnrisby avatar Sep 30 '21 15:09 johnrisby