mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 09:26:03 +00:00
fix(tags): three tags and "…" on the host's VM list too
The host's VM list showed every tag of a VM, widening its Name column as the VM list did before; it now shows three and the others behind "…". There its tags are not buttons: the tags "…" shows take the focus, so a keyboard user is not sent back to the top of the page.
This commit is contained in:
parent
65b8110464
commit
6680e14ce4
5 changed files with 22 additions and 5 deletions
|
|
@ -137,10 +137,11 @@ if (typeof module !== "undefined") {
|
|||
document.addEventListener("click", function (event) {
|
||||
var more = event.target.closest("[data-show-tags]");
|
||||
if (more) {
|
||||
var others = more.nextElementSibling;
|
||||
more.hidden = true;
|
||||
more.nextElementSibling.hidden = false;
|
||||
// the focus is not lost with the button: the first tag shown takes it
|
||||
more.nextElementSibling.querySelector("button, [tabindex]")?.focus();
|
||||
others.hidden = false;
|
||||
// the focus is not lost with the button: the first tag shown takes it, or the tags if they are not buttons
|
||||
(others.querySelector("button") || others).focus();
|
||||
return;
|
||||
}
|
||||
var badge = event.target.closest("[data-tag-filter]");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue