#131
Zoom: keyboard focus is lost when Reset or Zoom out ends its own job
When a zoom button disables or hides itself while it has focus, keyboard focus drops to <body>, so the next Tab starts again from the top of the page.
Steps (Pele 1.13.0, Chromium):
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<div id="diagram" style="width: 320px"></div>
<div style="height: 3000px"></div>
<script src="https://cdn.jsdelivr.net/npm/pele@1.13.0/dist/pele.global.js"></script>
<script>
const source = 'flowchart TD\n Root --> A & B & C & D & E & F & G & H'
pele.mount(document.getElementById('diagram'), source, { zoom: 'auto' })
</script>- Tab to Zoom in and press Enter.
- Tab to Reset and press Enter. Focus is now on
<body>.
The same happens when Enter on Zoom out reaches fit scale, and when Zoom in reaches the maximum.
Expected: focus stays inside the drawing, for example on the drawing itself or on the next enabled button.
Activity
0No activity yet.