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 for editable regions

See original GitHub issue

Hi!

I’ve seen that you patched this issue but I think we need a placeholder text too. On a regular HTML input field, you have the placeholder attribute. For instance, you can have this code:

<input type='text' name='username' value='' placeholder='Please enter a username'>

The code above will display a faded text on the field. When the user clicks the field, the placeholder text will still be shown and only disappear if the user types something. When the user deletes everything again, the placeholder text will be shown again. This would be very beneficial to have in Content Tools too 😃

To be more specific, here’s the kind of usage that I’m looking for:

<div class="article-title" data-editable data-name="article-title" data-placeholder-type="h1" data-placeholder="Enter a title here">

So data-placeholder-type AND a data-placeholder on a data-editable div would be awesome 😄


Also, i noticed a small bug for the issue mentioned above (#180): if you have an element like this:

<div class="article-title" data-editable data-name="article-title" data-placeholder-type="h1">

and you delete all the text, there will be a new empty <h1> added (which was the whole purpose of that enhancement), but if you click on another editable element in the page, such as:

<div id="article-content" class="article-content" data-editable data-name="article-content">

then it will reset back to a <p> element.

Thanks for your time and keep up the great job 😃

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
anthonyjbcommented, Jul 29, 2016

@okaybmd thanks very much for all your detailed feedback - really useful 👍

1reaction
okaybmdcommented, Jul 28, 2016

Edit: I can’t upload a zip file, it says Unfortunately, we don’t support that file type. Choose Files Try again with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. But it is a zip! AAAAH!

So I’ve uploaded the file here: http://www.filedropper.com/contenttools-edit

Thanks again for all you’ve done 😃

2nd edit: I’m using Chrome too (Version 51.0.2704.103 m) on Windows 7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying Editable Regions in a Playground Page
You can add placeholder tokens to editable areas. Placeholder tokens are rendered as selectable labels and can contain spaces and special characters.
Read more >
javascript - Placeholder for contenteditable div - Stack Overflow
The placeholder works fine and dandy until you type something, ctrl + A , and delete . If you do that, the placeholder...
Read more >
Editable regions text input placeholder? - CouchCMS
Is it possible to add a placeholder to an editable region of type text or textarea? Re: Editable regions text input placeholder?
Read more >
Placeholder support for contentEditable elements ... - CodePen
Placeholder support for contentEditable elements, without JavaScript · Notes · Console · Editor Commands · Editor Focus · Misc · HTML Specific ·...
Read more >
Placeholder for a contenteditable element - HTML DOM
Placeholder for a contenteditable element · 1. Use the :empty selector · 2. Handle the events.
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