mirror of
https://github.com/mipmip/home-manager-option-search.git
synced 2024-10-05 13:17:27 +03:00
add tabindex to search results enabling selection through tab + enable opening selected result using return
This commit is contained in:
parent
3ff0382a99
commit
ea5b42d995
15
js/script.js
15
js/script.js
@ -83,10 +83,19 @@ var updateOptionsTable = function(options) {
|
||||
att1.value = "optrow";
|
||||
tableRow.setAttributeNode(att1);
|
||||
|
||||
var att2 = document.createAttribute("tabindex");
|
||||
att2.value = "0";
|
||||
tableRow.setAttributeNode(att2);
|
||||
|
||||
var att2 = document.createAttribute("style");
|
||||
att2.value = "overflow-wrap: break-word";
|
||||
titleColumn.setAttributeNode(att2);
|
||||
tableRow.onkeydown = function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
tableRow.click();
|
||||
};
|
||||
};
|
||||
|
||||
var att3 = document.createAttribute("style");
|
||||
att3.value = "overflow-wrap: break-word";
|
||||
titleColumn.setAttributeNode(att3);
|
||||
|
||||
tableRow.appendChild(titleColumn);
|
||||
tableRow.appendChild(descriptionColumn);
|
||||
|
Loading…
Reference in New Issue
Block a user