mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:54:23 +08:00
Revert "A11Y: Improve setting focus to post" (#23311)
This reverts commit 9b3fc8081a
.
This commit is contained in:
parent
d47a3e053a
commit
76f4142d3f
|
@ -803,9 +803,7 @@ export default {
|
|||
},
|
||||
|
||||
_onScrollEndsCallback() {
|
||||
document
|
||||
.querySelector(".topic-post.selected a:not([tabindex='-1'])")
|
||||
?.focus();
|
||||
document.querySelector(".topic-post.selected span.tabLoc")?.focus();
|
||||
},
|
||||
|
||||
categoriesTopicsList() {
|
||||
|
|
|
@ -77,8 +77,7 @@ export function highlightPost(postNumber) {
|
|||
return;
|
||||
}
|
||||
|
||||
// sets focus to the first focusable anchor in the post
|
||||
container.querySelector("a:not([tabindex='-1'])")?.focus();
|
||||
container.querySelector(".tabLoc")?.focus();
|
||||
|
||||
const element = container.querySelector(".topic-body");
|
||||
if (!element || element.classList.contains("highlighted")) {
|
||||
|
|
|
@ -190,6 +190,9 @@ export default createWidget("post-small-action", {
|
|||
}
|
||||
|
||||
return [
|
||||
h("span.tabLoc", {
|
||||
attributes: { "aria-hidden": true, tabindex: -1 },
|
||||
}),
|
||||
h("div.topic-avatar", iconNode(icons[attrs.actionCode] || "exclamation")),
|
||||
h("div.small-action-desc", [
|
||||
h("div.small-action-contents", contents),
|
||||
|
|
|
@ -751,7 +751,11 @@ createWidget("post-article", {
|
|||
},
|
||||
|
||||
html(attrs, state) {
|
||||
const rows = [];
|
||||
const rows = [
|
||||
h("span.tabLoc", {
|
||||
attributes: { "aria-hidden": true, tabindex: -1 },
|
||||
}),
|
||||
];
|
||||
if (state.repliesAbove.length) {
|
||||
const replies = state.repliesAbove.map((p) => {
|
||||
return this.attach("embedded-post", p, {
|
||||
|
|
|
@ -1170,6 +1170,11 @@ blockquote > *:last-child {
|
|||
);
|
||||
min-width: 0; // Allows flex container to shrink
|
||||
|
||||
.avatar {
|
||||
margin-right: 0.5em;
|
||||
float: left;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
padding: 0.15em 0.5em 0 0;
|
||||
|
@ -1178,13 +1183,6 @@ blockquote > *:last-child {
|
|||
|
||||
.small-action-contents {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
a.trigger-user-card {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-right: 0.5em;
|
||||
border-radius: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.small-action-buttons {
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
box-shadow: -3px 0 0 var(--danger);
|
||||
}
|
||||
|
||||
.tabLoc:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.latest .featured-topic {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user