Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13386 closed bug (worksforme)

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.

Change History (2)

comment:1 Changed 7 years ago by anonymous

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

});

comment:2 Changed 7 years ago by dmethvin

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.