-  
 -   Notifications  
You must be signed in to change notification settings  - Fork 1.8k
 
Closed
Description
Basic info:
- Node.js version: v9.3.0
 - jsdom version: 11.5.1
 
Minimal reproduction case
const { JSDOM, VirtualConsole } = require("jsdom"); const options = { virtualConsole: new VirtualConsole().sendTo(console) }; const dom = new JSDOM(` <div> <input className="a" type="text" /> <input className="b" type="text" /> </div> `, options); // tab into a let event = new dom.window.KeyboardEvent('keydown', { keyCode: 9 }); // Tab key dom.window.dispatchEvent(event); console.log("Should be a: "+ dom.window.document.activeElement.className); // now to b event = new dom.window.KeyboardEvent('keydown', { keyCode: 9 }); // Tab key dom.window.dispatchEvent(event); console.log("Should be b: "+ dom.window.document.activeElement.className); // And back to a event = new dom.window.KeyboardEvent('keydown', { keyCode: 9 }); // Tab key dom.window.dispatchEvent(event); console.log("Should be a: "+ dom.window.document.activeElement.className); How does similar code behave in browsers?
Focus changes between the two input elements in a rotating manner as multiple tabs are pressed
just-boris
Metadata
Metadata
Assignees
Labels
No labels