问题描述
我有一个CellTable,它有一堆呈现给< input>
标签的单元格。由于CellTable的花哨事件处理,输入之间的选项卡被打破。看起来这个选项卡激发了每个单元格 finishEditing
,但这反过来又成为焦点,焦点永远不会到达下一个< input>
。
I have a CellTable with a bunch of cells that render to <input>
tags. Tabbing between the inputs is broken because of CellTable's fancy event processing. It seems that tab inspires each cell to finishEditing
, but that in turn hogs the focus and the focus never gets to the next <input>
.
对每个输入设置tabIndex似乎不会影响行为。
Setting tabIndex on each input does not seem to affect the behavior.
如何恢复通常的Tab键功能?
How can I restore the usual tabbing functionality?
推荐答案
我最近弄清楚了这一点。令人讨厌,但很简单,一旦你找到了魔法。
I recently figured this out. Annoying, but simple once you find the magic.
- 创建一个新的单元格类型在您的表格中使用,因为股票TextInputCell指定一个选项卡指数为-1。基本上做TextInputCell所做的一切,但不要在模板中指定任何标签索引。
- 禁用CellTable上的默认键盘导航。
cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED)
- Create a new Cell type to use in your table, as the stock TextInputCell specifies a tab index of -1. Basically do everything that TextInputCell does, but dont specify any tab index in your template.
- Disable the default keyboard navigation on your CellTable.
cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED)
这应该会导致正常您的CellTable中的标签导航。
This should result in a normal tab navigation in your CellTable.
这篇关于从输入中切换到CellTable中的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!