DEV: Only focus user card first link if not mouse input (#18960)

This commit is contained in:
Keegan George 2022-11-10 10:12:03 -08:00 committed by GitHub
parent 07e1b0591f
commit 85bfabd847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -280,10 +280,12 @@ export default Mixin.create({
// note: we DO NOT use afterRender here cause _positionCard may
// run afterwards, if we allowed this to happen the usercard
// may be offscreen and we may scroll all the way to it on focus
discourseLater(() => {
const firstLink = this.element.querySelector("a");
firstLink && firstLink.focus();
}, 350);
if (event.pointerId === -1) {
discourseLater(() => {
const firstLink = this.element.querySelector("a");
firstLink && firstLink.focus();
}, 350);
}
}
});
},