nnhubbard / ZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
MIT License
3.78k stars 585 forks source link

placeholder not working? #92

Closed stanleyfok closed 8 years ago

stanleyfok commented 9 years ago

seems cannot set placeholder?

Milan3792 commented 9 years ago

Hey stanleyfok, Did you find anything for adding placeholder?

hagile commented 9 years ago

+1

zhi-guan commented 8 years ago

in editor.html

<div id="zss_editor_content" style="width: 100%; height: 100%; -webkit-overflow-scrolling: touch; overflow: auto;" contenteditable="true" placeholder="Type something..."></div>
<div id="zss_editor_footer"> </div>

add "placeholder" property to zss_editor_content div and set it value what u want,then use css to control it(for example:#zss_editor_content:empty:before{content: attr(placeholder);color:#bbb;}#zss_editor_content:focus:before{content:none;})

Sadly, this is an ugly way :(

ghost commented 8 years ago

I will add getting the placeholder feature working to my list of things to do.

ghost commented 8 years ago

Placeholder is now working, you can set it using setPlaceholder.

[self setPlaceholder:@"placeholder text"];