Skip to content

Commit 4200adf

Browse files
committed
Merge pull request #6 from goldfire/add-shift-highlighting
Add shift highlighting
2 parents fb0bac0 + 34229be commit 4200adf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CanvasInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* CanvasInput v1.2.0
2+
* CanvasInput v1.2.1
33
* http://goldfirestudios.com/blog/108/CanvasInput-HTML5-Canvas-Text-Input
44
*
55
* (c) 2013-2015, James Simpson of GoldFire Studios
@@ -149,6 +149,8 @@
149149
// update the canvas input state information from the hidden input
150150
self._value = self._hiddenInput.value;
151151
self._cursorPos = self._hiddenInput.selectionStart;
152+
// update selection to hidden input's selection in case user did keyboard-based selection
153+
self._selection = [self._hiddenInput.selectionStart, self._hiddenInput.selectionEnd];
152154
self.render();
153155

154156
if (self._hasFocus) {

0 commit comments

Comments
 (0)