refactor: Convert collapser span to button for accessibility

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-03 00:48:22 +00:00
parent 0f87d47536
commit b1d4fc2903
2 changed files with 11 additions and 1 deletions

View File

@@ -85,7 +85,7 @@ function Comments({ cache }) {
{' '} | <HashLink to={'#'+cid} id={cid}>{moment.unix(c.date).fromNow()}</HashLink> {' '} | <HashLink to={'#'+cid} id={cid}>{moment.unix(c.date).fromNow()}</HashLink>
{hidden || hasChildren && {hidden || hasChildren &&
<span className='collapser pointer' onClick={() => collapseComment(cid)}></span> <button className='collapser pointer' onClick={() => collapseComment(cid)}></button>
} }
</p> </p>
</div> </div>

View File

@@ -215,6 +215,16 @@ span.source {
padding-right: 1.5rem; padding-right: 1.5rem;
} }
button.collapser {
background: transparent;
border: none;
margin: 0;
padding-top: 0;
padding-bottom: 0;
font: inherit;
color: inherit;
}
.comment .pointer { .comment .pointer {
cursor: pointer; cursor: pointer;
} }