admin管理员组文章数量:1356927
I understand that the draft js editor is not a classic textarea element. I applied some styles to make it look better. However, i can't find this little trick that doing a natural html focus effect when i'm focusing on my draftjs editor. I am not a css expert, i've tried to using the :active
pseudo class the effect disappear once a release the click.
I just want the borders to be like a classic html input focus effect.
How can a set up this ?
thanks
I understand that the draft js editor is not a classic textarea element. I applied some styles to make it look better. However, i can't find this little trick that doing a natural html focus effect when i'm focusing on my draftjs editor. I am not a css expert, i've tried to using the :active
pseudo class the effect disappear once a release the click.
I just want the borders to be like a classic html input focus effect.
How can a set up this ?
thanks
Share Improve this question asked Mar 21, 2017 at 7:49 JohnJohn 3372 gold badges6 silver badges14 bronze badges1 Answer
Reset to default 9You can keep track of whether or not the editor has focus by listening for onFocus
and onBlur
on it. You can then use this information to set classnames accordingly. Here's an example that makes the border red when it has focus:
https://jsfiddle/m7tovuqa/
本文标签: javascriptHow to give a focus effect to my Draft JS Editor borderStack Overflow
版权声明:本文标题:javascript - How to give a focus effect to my Draft JS Editor border? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744029617a2578666.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论