Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编辑中是否可以加一个placeholder #37

Closed
beijishiqidu opened this issue Sep 9, 2015 · 6 comments
Closed

编辑中是否可以加一个placeholder #37

beijishiqidu opened this issue Sep 9, 2015 · 6 comments

Comments

@beijishiqidu
Copy link

qq 20150909100341
类似于截图中的效果。

我之前也做过一个div的编辑器,简单的代码如下:

 

借助了Jquery的placeholder的插件才兼容了IE浏览器。

就想着如果你的实现也是在div的基础上弄的,那应该也容易吧?

@wangfupeng1988
Copy link
Collaborator

编辑器目前不支持 placeholder ,因为编辑器实际上是一个 div,而不是一个textarea。
我可以告诉你一个方法:
你让页面默认显示一个input,其中加上placeholder属性。当用户focus这个input时候,再显示编辑器。

我还专门为你做了了一个demo:http://www.wangeditor.com/wangEditor/test/test-placeholder.html
源代码:https://github.com/wangfupeng1988/wangEditor/blob/master/test/test-placeholder.html

@wangfupeng1988
Copy link
Collaborator

提问者长时间不反馈,先把问题关闭,如有需要,再重新向我反馈。

@lgd5555
Copy link

lgd5555 commented Feb 18, 2016

我在使用移动版的时候遇到这个问题是这样解决的,给textarea添加onclick时间,点击编辑器初始化
<textarea class="text" id="textarea1" onclick="editinit()" placeholder="快记录下你的话"><textarea>
function editinit(){ editor.init(); }

@wangfupeng1988
Copy link
Collaborator

@lgd5555 新问题重新提交一个issue,并且去移动版的项目下面去提交。放在这儿就乱了

@lgd5555
Copy link

lgd5555 commented Feb 18, 2016

哦,这不是新的问题,只是一个可适用于移动编辑器的解决方案,我想也许可以用在PC端

@wangfupeng1988
Copy link
Collaborator

@lgd5555 哦。。。抱歉哈,我一时大意看错了。。。感谢你的答复

wangfupeng1988 added a commit that referenced this issue Oct 7, 2020
wangfupeng1988 added a commit that referenced this issue Apr 11, 2022
fix: 修复 modal 中的 input 没有被 focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants