【问题标题】:Slickgrid cell text selection does not work properly in Chrome or FirefoxSlickgrid 单元格文本选择在 Chrome 或 Firefox 中无法正常工作
【发布时间】:2013-08-26 03:54:51
【问题描述】:

我已经根据SlickGrid and Text Selection设置了enableTextSelectionOnCells。

我对此并不满意。

选择单元格文本时行为不良。有时一旦选择完成,选择就会消失。仅在极少数情况下有效。

有人遇到过这个问题吗?

我已经在 Firefox 和 Chrome 上尝试过。

复制:

  1. git clone git@github.com:mleibman/SlickGrid.git
  2. 转到examples文件夹
  3. 编辑example1-simple.html
  4. 在选项中添加enableTextSelectionOnCells: true
  5. 在 FF/Chrome 中打开 example1-simple.html
  6. 尝试选择一个单元格值

仅供参考,如果有什么不同的话,我会在 Ubuntu 上运行。

【问题讨论】:

  • 我在 chrome 上遇到了同样的问题。
  • 我也有同样的问题。

标签: slickgrid


【解决方案1】:

Github 已经解决了这个问题。你只需要修改 slick.gird.js。在第 2270 行附近,您只需添加“options.editable &&”。希望对您有所帮助。

if (!currentEditor) {
    // if this click resulted in some cell child node getting focus,
    // don't steal it back - keyboard events will still bubble up
    // IE9+ seems to default DIVs to tabIndex=0 instead of -1, so check for cell clicks directly.
    if (options.editable && e.target != document.activeElement || $(e.target).hasClass("slick-cell")) {
      setFocus();
    }
  }

【讨论】:

  • 谢谢。很久以前放弃后,我完全忘记了这一点
猜你喜欢
  • 2023-03-13
  • 2015-03-27
  • 2019-03-05
  • 2011-03-31
  • 1970-01-01
  • 2015-04-27
  • 1970-01-01
  • 1970-01-01
  • 2016-07-07
相关资源
最近更新 更多