WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Cannot activate links with Keyboard

for

Number of posts in this thread: 7 (In chronological order)

From: Joseph Sherman
Date: Wed, Sep 05 2018 7:50AM
Subject: Cannot activate links with Keyboard
No previous message | Next message →

Hi all. We have a new page going up (https://slu.cuny.edu/) and while I can TAB to the top of page and main menu items ("Prospective Students, Current Students; About, etc.), I cannot activate them with the Enter key on the keyboard (Please ignore the other issues we are working on). I assume it has something to do with the javascript event listener Keydown event, but I'm not sure what the issue is or how to fix it.

Any suggestions appreciated. Thanks.


Joseph

From: Patrick H. Lauke
Date: Wed, Sep 05 2018 8:41AM
Subject: Re: Cannot activate links with Keyboard
← Previous message | Next message →

On 05/09/2018 14:50, Joseph Sherman wrote:
> Hi all. We have a new page going up (https://slu.cuny.edu/) and while I can TAB to the top of page and main menu items ("Prospective Students, Current Students; About, etc.), I cannot activate them with the Enter key on the keyboard (Please ignore the other issues we are working on). I assume it has something to do with the javascript event listener Keydown event, but I'm not sure what the issue is or how to fix it.


no time to deep dive and test, but my hunch would be: in function.js there's

// Keyboard-friendly Navigation
$( 'header ul.menu a' ).on( 'keydown', function( e ) {
if ( e.which != 9 ) {
e.preventDefault();
}
...

Essentially, unless it's the TAB key, this preventDefaults browser
behavior altogether...(e.g. reacting to enter etc).

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Isabel Holdsworth
Date: Wed, Sep 05 2018 8:47AM
Subject: Re: Cannot activate links with Keyboard
← Previous message | Next message →

Hi Joseph,

It looks as though the menu system can be traversed using the arrow
keys. Perhaps the script that's providing that functionality is
preventing the default behaviour for those links.

Cheers, Isabel

On 05/09/2018, Joseph Sherman < = EMAIL ADDRESS REMOVED = > wrote:
> Hi all. We have a new page going up (https://slu.cuny.edu/) and while I can
> TAB to the top of page and main menu items ("Prospective Students, Current
> Students; About, etc.), I cannot activate them with the Enter key on the
> keyboard (Please ignore the other issues we are working on). I assume it has
> something to do with the javascript event listener Keydown event, but I'm
> not sure what the issue is or how to fix it.
>
> Any suggestions appreciated. Thanks.
>
>
> Joseph
>
> > > > >

From: Birkir R. Gunnarsson
Date: Wed, Sep 05 2018 8:53AM
Subject: Re: Cannot activate links with Keyboard
← Previous message | Next message →

Definitely lookout for any preventDefault code in the Javascriptfor the page.
The links work fine with a simulated click event, so something is
preventing the enter key from firing those events, and you need
event.preventDefault to do that for links (because natively the enter
key triggers their onclick event).
Oh, the joys of well-intended but badly coded web-based menus.



On 9/5/18, Isabel Holdsworth < = EMAIL ADDRESS REMOVED = > wrote:
> Hi Joseph,
>
> It looks as though the menu system can be traversed using the arrow
> keys. Perhaps the script that's providing that functionality is
> preventing the default behaviour for those links.
>
> Cheers, Isabel
>
> On 05/09/2018, Joseph Sherman < = EMAIL ADDRESS REMOVED = > wrote:
>> Hi all. We have a new page going up (https://slu.cuny.edu/) and while I
>> can
>> TAB to the top of page and main menu items ("Prospective Students,
>> Current
>> Students; About, etc.), I cannot activate them with the Enter key on the
>> keyboard (Please ignore the other issues we are working on). I assume it
>> has
>> something to do with the javascript event listener Keydown event, but I'm
>> not sure what the issue is or how to fix it.
>>
>> Any suggestions appreciated. Thanks.
>>
>>
>> Joseph
>>
>> >> >> >> >>
> > > > >


--
Work hard. Have fun. Make history.

From: Jonathan Avila
Date: Wed, Sep 05 2018 2:57PM
Subject: Re: Cannot activate links with Keyboard
← Previous message | Next message →

> I cannot activate them with the Enter key on the keyboard (Please ignore the other issues we are working on).

I would ask if a screen reader is running or not when this behavior occurs. Some screen readers send a click when enter is pressed in virtual cursor mode (some have settings to change this behavior). It should work correctly when enter is sent or via the click event to support a wide range of users.

Jonathan

From: glen walker
Date: Wed, Sep 05 2018 3:04PM
Subject: Re: Cannot activate links with Keyboard
← Previous message | Next message →

I had tried it without a screen reader and the ENTER was not processed. I
agree with Patrick's original assessment that preventDefault() is draining
the ENTER and not letting it get passed up the chain.

On Wed, Sep 5, 2018 at 2:57 PM Jonathan Avila < = EMAIL ADDRESS REMOVED = >
wrote:

> > I cannot activate them with the Enter key on the keyboard (Please ignore
> the other issues we are working on).
>
> I would ask if a screen reader is running or not when this behavior
> occurs. Some screen readers send a click when enter is pressed in virtual
> cursor mode (some have settings to change this behavior). It should work
> correctly when enter is sent or via the click event to support a wide range
> of users.
>
> Jonathan
>
>

From: Osmo Saarikumpu
Date: Thu, Sep 06 2018 12:23AM
Subject: Re: Cannot activate links with Keyboard
← Previous message | No next message

Keyboard navigation works for me as I surf with script support off, by
default. In the old days, the fathers taught a long ago forgotten
principle of web desing: do not mix navigation and scripting. But today,
alas, every design flaw seems $(olvable)!

https://dev.opera.com/articles/javascript-best-practices/#progressiveenhancement

--
Best wishes, Osmo

On 05/09/2018 16:50, Joseph Sherman wrote:
> Hi all. We have a new page going up (https://slu.cuny.edu/) and while I can TAB to the top of page and main menu items ("Prospective Students, Current Students; About, etc.), I cannot activate them with the Enter key on the keyboard (Please ignore the other issues we are working on). I assume it has something to do with the javascript event listener Keydown event, but I'm not sure what the issue is or how to fix it.
>
> Any suggestions appreciated. Thanks.
>
>
> Joseph
>
> > > > >