Accessibility: Move column extra buttons out of h1 column heading (#39305)

This commit is contained in:
diondiondion 2026-06-08 12:16:33 +02:00 committed by GitHub
parent 87024b9e1c
commit bcafd7d0c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View File

@ -152,7 +152,7 @@ export const ColumnHeader: React.FC<Props> = ({
active,
});
const buttonClassName = classNames('column-header', {
const headingClassName = classNames('column-header', {
active,
});
@ -276,16 +276,14 @@ export const ColumnHeader: React.FC<Props> = ({
</>
);
const HeadingElement = hasTitle ? 'h1' : 'div';
const component = (
<div className={wrapperClassName}>
<HeadingElement className={buttonClassName}>
<div className={headingClassName}>
{hasTitle && (
<>
<h1 className='column-header__title-wrapper'>
{backButton}
{onClick && (
{onClick ? (
<button
onClick={handleTitleClick}
className='column-header__title'
@ -294,8 +292,7 @@ export const ColumnHeader: React.FC<Props> = ({
>
{titleContents}
</button>
)}
{!onClick && (
) : (
<span
className='column-header__title'
tabIndex={-1}
@ -304,7 +301,7 @@ export const ColumnHeader: React.FC<Props> = ({
{titleContents}
</span>
)}
</>
</h1>
)}
{!hasTitle && backButton}
@ -313,7 +310,7 @@ export const ColumnHeader: React.FC<Props> = ({
{extraButton}
{collapseButton}
</div>
</HeadingElement>
</div>
<div
className={collapsibleClassName}

View File

@ -4638,9 +4638,14 @@ a.status-card {
z-index: 2;
outline: 0;
&__title-wrapper {
flex-grow: 1;
}
&__title {
display: flex;
align-items: center;
width: 100%;
gap: 5px;
margin: 0;
border: 0;
@ -4653,7 +4658,6 @@ a.status-card {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
flex: 1;
&:focus-visible {
outline: var(--outline-focus-default);