question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Placeholder is selectable and prevents paste in IE 11

See original GitHub issue

Do you want to request a feature or report a bug?

bug

What’s the current behavior?

Using IE 11, the text of the placeholder can be selected and if the cursor is placed somewhere else than at the beginning of the placeholder text, it is not possible to paste (using shortcut or context menu).

test

Tested with the rich-text example http://slatejs.org/#/rich-text in IE11 on Windows 7 and Windows 10.

What’s the expected behavior?

The placeholder can not be selected and the cursor can not be placed somewhere within the placeholder text, preventing the user from pasting.

Research / Workaround

In slate, there is an editor element with contenteditable set to true. It contains the placeholder as a child which has contenteditableset to false.

The HTML5 specs say: a contenteditable=false element within a contenteditable=true element is not editable.

I discovered that IE 11 seems to have a somewhat weird interpretation of the spec and does it the other way round: only child elements with contenteditable=true are not editable.

I tried to fix that issue by setting the placeholder element tocontenteditable=false but that introduces some other weird behaviour.

My current workaround is to provide an own placeholder component that is placed as a sibling to the editor component. The downside is that I have to reimplement the show/hide logic.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brendancarneycommented, Feb 23, 2019

Appears to be fixed: ie11

1reaction
kudlajzcommented, Apr 3, 2018

@ianstormtaylor We’re using version 0.33.4 and the problem still persists 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

Placeholder CSS not being applied in IE 11 - Stack Overflow
After some hit and try, I get solution of my problem, but it's amazing. If i removed the default css/style color on input-box,...
Read more >
:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any or element that is currently displaying placeholder text.
Read more >
Copy and paste problem when using Yammer in Internet ...
Copy and paste problem when using Yammer in Internet Explorer · In Internet Explorer, go to Settings > Internet options, and then click...
Read more >
::placeholder | CSS-Tricks - CSS-Tricks
:placeholder-shown, being a pseudo-class, has to select an existing element – it selects the input whenever you're in the ...
Read more >
Can I insert values in favorites location, parameters or ...
See Debugging placeholders and user variables. Note: Support for placeholders in Launch with field requires v11.5.6.9.1. Clipboard. You can use the Windows ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found