Skip to content

Commit 1312125

Browse files
committed
Remove focus events on when showing a card
Resolves h5p#102
1 parent 7a7580a commit 1312125

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/scripts/h5p-dialogcards-card.js

-17
Original file line numberDiff line numberDiff line change
@@ -468,23 +468,6 @@ class Card {
468468
}
469469
}
470470

471-
/**
472-
* Set focus to a given card.
473-
* @param {boolean} force If true, don't wait for transition.
474-
*/
475-
setCardFocus(force) {
476-
if (force === true) {
477-
this.$cardTextArea.focus();
478-
}
479-
else {
480-
// Wait for transition, then set focus
481-
const $card = this.getDOM();
482-
$card.one('transitionend', () => {
483-
$card.focus()
484-
});
485-
}
486-
}
487-
488471
/**
489472
* Stop audio of card.
490473
*/

src/scripts/h5p-dialogcards.js

-3
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ class Dialogcards extends H5P.EventDispatcher {
608608

609609
this.currentCardId = targetPosition;
610610
this.updateNavigation();
611-
this.cards[this.currentCardId].setCardFocus();
612611
};
613612

614613
/**
@@ -642,7 +641,6 @@ class Dialogcards extends H5P.EventDispatcher {
642641
this.createDOM();
643642

644643
this.updateNavigation();
645-
this.cards[this.currentCardId].setCardFocus(true);
646644

647645
this.trigger('resize');
648646
};
@@ -672,7 +670,6 @@ class Dialogcards extends H5P.EventDispatcher {
672670
this.showAllAudio();
673671

674672
this.cards[this.currentCardId].resizeOverflowingText();
675-
this.cards[this.currentCardId].setCardFocus();
676673
};
677674

678675
/**

0 commit comments

Comments
 (0)