Merge pull request #298 from orangemug/fix/keyboard-accessible-buttons

Made buttons keyboard accessible
This commit is contained in:
Orange Mug 2018-05-11 10:47:11 +01:00 committed by GitHub
commit 354b2fb3cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 7 deletions

View file

@ -63,13 +63,13 @@ class ToolbarAction extends React.Component {
} }
render() { render() {
return <a return <button
className='maputnik-toolbar-action' className='maputnik-toolbar-action'
data-wd-key={this.props.wdKey} data-wd-key={this.props.wdKey}
onClick={this.props.onClick} onClick={this.props.onClick}
> >
{this.props.children} {this.props.children}
</a> </button>
} }
} }

View file

@ -208,21 +208,21 @@ class LayerListContainer extends React.Component {
<span className="maputnik-space" /> <span className="maputnik-space" />
<div className="maputnik-default-property"> <div className="maputnik-default-property">
<div className="maputnik-multibutton"> <div className="maputnik-multibutton">
<a <button
onClick={this.toggleLayers.bind(this)} onClick={this.toggleLayers.bind(this)}
className="maputnik-button"> className="maputnik-button">
{this.state.areAllGroupsExpanded === true ? "Collapse" : "Expand"} {this.state.areAllGroupsExpanded === true ? "Collapse" : "Expand"}
</a> </button>
</div> </div>
</div> </div>
<div className="maputnik-default-property"> <div className="maputnik-default-property">
<div className="maputnik-multibutton"> <div className="maputnik-multibutton">
<a <button
onClick={this.toggleModal.bind(this, 'add')} onClick={this.toggleModal.bind(this, 'add')}
data-wd-key="layer-list:add-layer" data-wd-key="layer-list:add-layer"
className="maputnik-button maputnik-button-selected"> className="maputnik-button maputnik-button-selected">
Add Layer Add Layer
</a> </button>
</div> </div>
</div> </div>
</header> </header>

View file

@ -53,6 +53,7 @@
font-size: $font-size-6; font-size: $font-size-6;
padding: $margin-2; padding: $margin-2;
user-select: none; user-select: none;
border-width: 0;
border-radius: 2px; border-radius: 2px;
box-sizing: border-box; box-sizing: border-box;

View file

@ -91,7 +91,6 @@
.maputnik-button-selected { .maputnik-button-selected {
background-color: lighten($color-midgray, 12); background-color: lighten($color-midgray, 12);
outline: 1px $color-white;
color: white; color: white;
} }

View file

@ -57,6 +57,8 @@
} }
.maputnik-toolbar-action { .maputnik-toolbar-action {
background: inherit;
border-width: 0;
@extend .maputnik-toolbar-link; @extend .maputnik-toolbar-link;
} }