]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6927
authorsoufiane <soufiane@cubedesigners.com>
Wed, 22 May 2024 12:45:23 +0000 (14:45 +0200)
committersoufiane <soufiane@cubedesigners.com>
Wed, 22 May 2024 12:45:23 +0000 (14:45 +0200)
js/quiz.accessibility.js

index 209057796e8c14ceed9e8028331cf853a95c2fa7..5f08b0cfda75322d694792bf6dd8faa0c76b50b5 100644 (file)
@@ -8,19 +8,15 @@ QuizAccessibility.prototype = {
     initShortcuts: function () {
         let $this = this;
         $(document).on('keyup', function (e) {
-            console.log('entrer 1')
             if($("textarea:focus,input:focus").length < 1) {
                 let key = e.key.toLocaleUpperCase();
-                console.log('key',key)
                 if (key === ' ') {
                     key = 'Space';
                 }
 
                 $('[aria-keyshortcuts="' + key + '"]').each(function () {
                     if ($this.quiz.utils.isEnabled($(this))) {
-                        $(this).get(0).click(function(e) {
-                            return false;
-                        });
+                        $(this).get(0).click();
                         return true;
                     }
                 });
@@ -28,7 +24,9 @@ QuizAccessibility.prototype = {
                 if (key === 'ENTER') {
                     let el = $(':focus').find('[aria-keyshortcuts]')
                     if(!el) {
-                        $(':focus').click(function (e){ return false; })
+                        $('a[href=#]').click(function (e){
+                            return false;
+                        })
                     }
                     if ($this.quiz.utils.isEnabled(el)) {
                         el.get(0).click((e) => { return false; });