Looking for a better workaround to Chrome select on focus bug

前端 未结 9 1428
孤街浪徒
孤街浪徒 2020-11-30 02:56

I have the same problem as the user in this question, which is due to this bug in Webkit. However, the workaround provided will not work for my app. Let me re-state the prob

9条回答
  •  难免孤独
    2020-11-30 03:41

    Why not simply:

    $('#out').focus(function(){
        $(this).one('mouseup', function() {
            $(this).select();
        });
    });
    

    Seems to work in all major browsers...

提交回复
热议问题