マイペースなRailsおじさん

Ruby、Ruby on Rails、オブジェクト指向設計を主なテーマとして扱います。だんだん大きくなっていくRuby on Rails製プロダクトのメンテナンス性を損なわない方法を考えたり考えなかったりしている人のブログです。

2021-02-17から1日間の記事一覧

Set placeholder for 'contenteditable' element.

We can add placeholder to contenteditable element. HTML [contenteditable="true"]:empty::before { content: attr(data-placeholder); color: #ccc; } CSS <p contenteditable="true" data-placeholder="Please input something."></p> And then we placeholder appers. Sample https://jsfiddle.net/ytnk531/tgLw1fv5/…

tribute.js supports `contenteditable`

tribute.js is used to implement mention feature. GitHub - zurb/tribute: ES6 Native @mentions By the way, in Slack (and some chat applications) highlights inputted mentions as illustrated below. tribute.js can implement such decoration. I i…