Skip to content

Commit

Permalink
Remove focus events on when showing a card
Browse files Browse the repository at this point in the history
Resolves h5p#102
  • Loading branch information
keevan committed Jul 13, 2021
1 parent 7a7580a commit 1312125
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
17 changes: 0 additions & 17 deletions src/scripts/h5p-dialogcards-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,23 +468,6 @@ class Card {
}
}

/**
* Set focus to a given card.
* @param {boolean} force If true, don't wait for transition.
*/
setCardFocus(force) {
if (force === true) {
this.$cardTextArea.focus();
}
else {
// Wait for transition, then set focus
const $card = this.getDOM();
$card.one('transitionend', () => {
$card.focus()
});
}
}

/**
* Stop audio of card.
*/
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/h5p-dialogcards.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ class Dialogcards extends H5P.EventDispatcher {

this.currentCardId = targetPosition;
this.updateNavigation();
this.cards[this.currentCardId].setCardFocus();
};

/**
Expand Down Expand Up @@ -642,7 +641,6 @@ class Dialogcards extends H5P.EventDispatcher {
this.createDOM();

this.updateNavigation();
this.cards[this.currentCardId].setCardFocus(true);

this.trigger('resize');
};
Expand Down Expand Up @@ -672,7 +670,6 @@ class Dialogcards extends H5P.EventDispatcher {
this.showAllAudio();

this.cards[this.currentCardId].resizeOverflowingText();
this.cards[this.currentCardId].setCardFocus();
};

/**
Expand Down

0 comments on commit 1312125

Please sign in to comment.