本文介绍了flex:如何防止在 flex3 文本输入中粘贴(ctrl+V)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我需要禁用在 textinout (flex3) 中粘贴文本:CTRL+V有什么想法吗?

HelloI need to disable pasting text in a textinout (flex3) : CTRL+VAny idea ?

请注意

推荐答案

这只会阻止粘贴多个字母,但它适用于大多数用途:

This only block pasting more than one letter, but it does work for most purposes:

<mx:TextInput textInput="if (event.text.length > 1) event.preventDefault()"/>

和火花:

<s:TextInput
   change="if (event.operation is PasteOperation)
   (event.target as SkinnableTextBase).text = '' "
/>

这篇关于flex:如何防止在 flex3 文本输入中粘贴(ctrl+V)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 21:13