diff --git a/static/hyperscript/pdf-modal._hs b/static/hyperscript/pdf-modal._hs index a148d5f..d067ec2 100644 --- a/static/hyperscript/pdf-modal._hs +++ b/static/hyperscript/pdf-modal._hs @@ -33,13 +33,3 @@ def selectPdfCard(card) set window.selectedPdfFormat to card's @data-cv-format end --- ============================================================================== --- PDF CARD KEYDOWN HANDLER --- ============================================================================== --- Handles keyboard navigation for PDF cards (Enter/Space to select) -def handlePdfCardKey(card, evt) - if evt.key is 'Enter' or evt.key is ' ' - call evt.preventDefault() - call selectPdfCard(card) - end -end diff --git a/templates/index.html b/templates/index.html index b68743c..2a543de 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,16 +4,15 @@
diff --git a/templates/partials/modals/pdf-modal.html b/templates/partials/modals/pdf-modal.html index 0b6984c..fa199e2 100644 --- a/templates/partials/modals/pdf-modal.html +++ b/templates/partials/modals/pdf-modal.html @@ -45,7 +45,7 @@ aria-label="{{.UI.PdfModal.ShortCv.AriaLabel}}" tabindex="0" _="on click call selectPdfCard(me) - on keydown call handlePdfCardKey(me, event)"> + on keydown[key is 'Enter' or key is ' '] halt the event then call selectPdfCard(me)">