【问题标题】:ExtJs 3.4 - Not able to select text in text field in FireFoxExtJs 3.4 - 无法在 FireFox 的文本字段中选择文本
【发布时间】:2012-09-24 08:57:24
【问题描述】:

我无法在 Firefox 的 extjs 文本字段中选择键入的文本。我可以在 IE 和 chrome 中选择键入的文本。

这个问题只出现在FF中。

对此有何想法或解决方案?

问题在于我的 css 导致用户无法选择文本

.unselectable {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

但我需要允许用户在不修改上述 css 的情况下选择文本。有什么想法吗?

【问题讨论】:

    标签: css firefox select extjs


    【解决方案1】:

    使用selectText方法选择文字

    selectText( [Number start], [Number end] );
    

    【讨论】:

    • 如何获取起始值和结束值?文本区域没有鼠标事件。我说的对吗?
    • @AJJ 您可以获取字段值,然后执行 value.length 并将其设置为开始和结束。但是,这对我来说在 IE 中不起作用
    猜你喜欢
    • 2021-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-25
    相关资源
    最近更新 更多