Side navigation
#13386 closed bug (worksforme)
Opened February 05, 2013 06:00AM UTC
Closed February 05, 2013 02:19PM UTC
focus() on contenteditable DIV with height & width of 0
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
For a DIV of size 0 with contenteditable true, jQuery focus() method doesn't seem to work. When I replace it with .get(0).focus(), the native JS method, it works.
Here's the exact code:
var pasteCatcher = $(document.createElement("div"));
pasteCatcher.attr("contenteditable","true").css({width : "0", height : "0", overflow : "hidden", outline : 0});
$("body").prepend(pasteCatcher);
$(document).bind("paste", function() {
pasteCatcher.focus(); // does not work but .get(0).focus() works
});