substance / surface

A building block for web-based text editors

Home Page:http://sandbox.substance.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A css-style for the current selection

michael opened this issue · comments

We might wanna have a style for the current selection, since now that we're using contenteditable.. the visual clue disappears one we switch the focus.

The particular usecase for this is adding a comment: You select some text and press ctrl+shift+c.. which triggers the new comment dialog to be shown in the comments tool. In order to visually indicate where the comment will be long to... we need to have it visualized.

<span class="selected">this is the selected range</span>

The selection style always needs to be updated when the selection changes, either by using the mouse.. or creating a new selection with the keyboard.