Skip to content

Commit

Permalink
Cures safari and Firefox focus problems with placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Pulges committed Jul 3, 2014
1 parent 18ae3b8 commit c33bc6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dom/simulate_placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
unset = function() {
if (view.hasPlaceholderSet()) {
view.clear();
view.selection.selectNode(view.element.firstChild);
view.element.focus();
setTimeout(function() {
var sel = view.selection.getSelection();
if (!sel.focusNode || !sel.anchorNode) {
view.selection.selectNode(view.element.firstChild || view.element);
}
}, 0);
}
view.placeholderSet = false;
dom.removeClass(view.element, CLASS_NAME);
Expand Down

0 comments on commit c33bc6c

Please sign in to comment.