fix: improve accessible label by using the property name (#2224)

This commit is contained in:
Dag Frode Solberg 2022-12-29 15:43:06 +01:00 committed by GitHub
parent b8f7da6b00
commit 12be1bc5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ export class Field extends React.Component<FieldProps> {
<button <button
onClick={this.toggle} onClick={this.toggle}
onKeyPress={this.handleKeyPress} onKeyPress={this.handleKeyPress}
aria-label="expand properties" aria-label={`expand ${name}`}
> >
<span className="property-name">{name}</span> <span className="property-name">{name}</span>
<ShelfIcon direction={expanded ? 'down' : 'right'} /> <ShelfIcon direction={expanded ? 'down' : 'right'} />