Skip to content

Commit

Permalink
Merge pull request #720 from slidewiki/SWIK-1814-SelectFileButtonAcce…
Browse files Browse the repository at this point in the history
…sibility

Swik 1814 select file button accesibility
  • Loading branch information
kadevgraaf committed Jan 23, 2018
2 parents 05d16d1 + f4b4d35 commit 1dcab75
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/AddDeck/AddDeck.js
Expand Up @@ -49,14 +49,23 @@ class AddDeck extends React.Component {
if (this.props.ImportStore.error !== null)
this.showError();
}

handleKeyPressUploadModal(event){
if(event.key === 'Enter'){
this.handleUploadModal(event);
}
}
handleUploadModal(x) {
//console.log('handleUploadModal: ', x);

$('.ui.small.modal').modal('show');
}
handleKeyPressAddDeck(event){
if(event.key === 'Enter'){
this.handleAddDeck(event);
}
}
handleAddDeck(x) {
//console.log('handleAddDeck');
console.log('handleAddDeck');

this.context.executeAction(addDeckDeleteError, null);

Expand Down Expand Up @@ -519,7 +528,7 @@ class AddDeck extends React.Component {
<div className="ui grid">
<div className="two column row">
<div className="column">
<div className={btnClasses_upload} role="button" tabIndex="0" aria-describedby="uploadDesc" onClick={this.handleUploadModal.bind(this)} >
<div className={btnClasses_upload} role="button" tabIndex="0" aria-describedby="uploadDesc" onClick={this.handleUploadModal.bind(this)} onKeyPress={this.handleKeyPressUploadModal.bind(this)} >
<FormattedMessage
id='AddDeck.form.button_select'
defaultMessage='Select file' />
Expand Down Expand Up @@ -565,7 +574,7 @@ class AddDeck extends React.Component {
</div>

<div className="ui buttons">
<div className={btnClasses_submit} aria-label={this.context.intl.formatMessage(form_messages.button_create)} role="button" tabIndex="0" onClick={this.handleAddDeck.bind(this)} >
<div className={btnClasses_submit} aria-label={this.context.intl.formatMessage(form_messages.button_create)} role="button" tabIndex="0" onClick={this.handleAddDeck.bind(this)} onKeyPress={this.handleKeyPressAddDeck.bind(this)} >
{this.context.intl.formatMessage(form_messages.button_create)}
</div>
</div>
Expand Down

0 comments on commit 1dcab75

Please sign in to comment.