bring back select-all-on-click
This commit is contained in:
parent
aa80a5d494
commit
d39a9a0f18
1 changed files with 9 additions and 0 deletions
|
@ -148,6 +148,15 @@ module.exports = React.createClass({
|
|||
|
||||
onFocus: function(ev) {
|
||||
//ev.target.setSelectionRange(0, ev.target.textContent.length);
|
||||
|
||||
var node = ev.target.childNodes[0];
|
||||
var range = document.createRange();
|
||||
range.setStart(node, 0);
|
||||
range.setEnd(node, node.length);
|
||||
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
},
|
||||
|
||||
onFinish: function(ev) {
|
||||
|
|
Loading…
Reference in a new issue