mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
blur active element on navigation - fixes #287
This commit is contained in:
@@ -161,6 +161,7 @@ function navigate(target: Target, id: number) {
|
||||
}
|
||||
|
||||
render(Page, props, scroll_history[id], token);
|
||||
document.activeElement.blur();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -608,6 +608,19 @@ function run({ mode, basepath = '' }) {
|
||||
it('emits a basepath', () => {
|
||||
assert.equal(captured_basepath, basepath);
|
||||
});
|
||||
|
||||
// skipped because Nightmare doesn't seem to focus the <a> correctly
|
||||
it.skip('resets the active element after navigation', () => {
|
||||
return nightmare
|
||||
.goto(base)
|
||||
.init()
|
||||
.click('a[href="about"]')
|
||||
.wait(100)
|
||||
.evaluate(() => document.activeElement.nodeName)
|
||||
.then(name => {
|
||||
assert.equal(name, 'BODY');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('headers', () => {
|
||||
|
||||
Reference in New Issue
Block a user