开发者

Copy-paste in textarea doesn't work in Chrome

开发者 https://www.devze.com 2023-03-12 14:26 出处:网络
I have a little mys开发者_运维技巧tery. When you have a div { display: none; } rule in your css, and a textarea on the page, it is impossible to copy and paste in the textarea in a Chrome browser.

I have a little mys开发者_运维技巧tery.

When you have a div { display: none; } rule in your css, and a textarea on the page, it is impossible to copy and paste in the textarea in a Chrome browser.

What's going on?

http://pastehtml.com/view/ax3tuefz3.html


I tried and yes the paste seems to be broken in your example.

There were some bugs reported on chrome buglist:

http://code.google.com/p/chromium/issues/detail?id=60057

http://code.google.com/p/chromium/issues/detail?id=61784

But they are long closed.


This is a bug in WebKit.

I've filed a bug report here: https://code.google.com/p/chromium/issues/detail?id=86025


Your problem isdisplay:none; is applying to all your divs.

I gave your button a class:

<div id="login" class="login">

And made sure the display:none; only applied to it

div.login {
    display: none;
}

Then I hid your form off the top

$('#view_form').hide();

Works now: http://jsbin.com/umugi5/3/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号