简体   繁体   中英

onchange event and auto grow textbox

i have made auto grow textarea.it's working fine but when copying and pasting using right click it's not working properly.if i use onchange event in this situation it won't work either because to fire this event we need press enter or tab. please help me to solve this problem

How about additionally listening to the onpaste event? It's not part of the standard, but works in most major browsers.

You could you a setTimeout to check the character length of the textarea and change it accordingly.. doesn't feel very nice though.

Alternatively you could detect that the right mouse button was clicked using the which or button variables. see here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM