KeyTable does not set activeElement
KeyTable does not set activeElement
sliekens
Posts: 97Questions: 17Answers: 2
I was surprised to find out that KeyTable does not set focus to its selected cell. In other words: document.activeElement
is not the selected <td>
. In my case the active element is set to the <body>
of the page when I select a cell.
Is there a reason why it is this way?
I'm asking because I want to attach keydown
handlers to selected cells for keys that are also handled by KeyTable itself. The keys
event is not triggered in this case.
This discussion has been closed.
Answers
Dumb question: you can't set the focus on a
<td>
or even<tr>
element. Doh!UNLESS
Apparently it's possible to focus cells if they have a
tabindex
attribute. Now I just need to figure out how to put it all together...