Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32259 > unrolled thread

Having to click TWICE for event

Started bybit-naughty@hotmail.com
First post2017-01-22 22:55 -0800
Last post2017-01-25 17:42 +0100
Articles 12 on this page of 32 — 7 participants

Back to article view | Back to comp.lang.javascript


Contents

  Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-22 22:55 -0800
    Re: Having to click TWICE for event Maik Koenig <usenetspam@maikkoenig.de> - 2017-01-23 09:08 +0100
      Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-23 10:47 -0800
        Re: Having to click TWICE for event Maik Koenig <usenetspam@maikkoenig.de> - 2017-01-23 22:45 +0100
          Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 06:00 -0800
            Re: Having to click TWICE for event Ram Tobolski <ramtob@gmail.com> - 2017-01-24 10:27 -0800
              Re: Having to click TWICE for event jonas.thornvall@gmail.com - 2017-01-24 10:55 -0800
              Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 11:05 -0800
                Re: Having to click TWICE for event Ram Tobolski <ramtob@gmail.com> - 2017-01-24 13:10 -0800
                  Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 22:56 -0800
                    Re: Having to click TWICE for event Maik Koenig <usenetspam@maikkoenig.de> - 2017-01-25 11:55 +0100
                      Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-25 07:03 -0800
                        Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-26 23:59 -0800
                    Re: Having to click TWICE for event Ram Tobolski <ramtob@gmail.com> - 2017-01-25 11:05 -0800
                  Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 23:25 -0800
                    Re: Having to click TWICE for event Maik Koenig <usenetspam@maikkoenig.de> - 2017-01-25 11:57 +0100
                    Re: Having to click TWICE for event Ram Tobolski <ramtob@gmail.com> - 2017-01-25 11:14 -0800
              Re: Having to click TWICE for event Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-01-24 21:41 +0100
                Re: Having to click TWICE for event Ram Tobolski <ramtob@gmail.com> - 2017-01-24 13:13 -0800
                Re: Having to click TWICE for event "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-24 23:46 +0100
                  Re: Having to click TWICE for event Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-01-25 00:20 +0100
                    Re: Having to click TWICE for event "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-25 11:19 +0100
                Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 23:00 -0800
                  Re: Having to click TWICE for event Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-01-25 09:32 +0100
                    Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-25 07:05 -0800
                      Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-26 23:58 -0800
                        Re: Having to click TWICE for event Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-01-27 12:48 +0100
                          Re: Having to click TWICE for event Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-27 13:13 +0100
                Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-24 23:03 -0800
                  Re: Having to click TWICE for event "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-25 11:21 +0100
                    Re: Having to click TWICE for event bit-naughty@hotmail.com - 2017-01-25 07:10 -0800
                      Re: Having to click TWICE for event "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-25 17:42 +0100

Page 2 of 2 — ← Prev page 1 [2]


#32317

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2017-01-25 00:20 +0100
Message-ID<o68nfd$uqi$1@csiph.com>
In reply to#32316
On 24/01/2017 23:46, Evertjan. wrote:
> Cezary Tomczyk <cezary.tomczyk@gmail.com> wrote on 24 Jan 2017 in
> comp.lang.javascript:
>
>> On 24/01/2017 19:27, Ram Tobolski wrote:
>>>> And then how do you code the link?
>>>
>>> Hi. You don't need the link (<a>), just the <div>. You are registering
>>> a listener to clicks on the <div>
>>
>> That's not a good idea as the <div> itself is not focusable and the user
>> will not be able to reach this button using keyboard. Except when you
>> add attribute tabindex="0", but I'd rather not use <div> with click
>> event instead use natively focusable <a> HTML element.
>
> Methinks, Cezary, it is a quite marvelous idea for programmers who are
> painfully aware of their own limitations in sofar as to add a "return
> false;" at the end of their listener codes, their focus on focusability
> rather being of another kind.

It's another kind, but still valuable.

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/
https://www.aslint.org/ - Accessibility linting tool

[toc] | [prev] | [next] | [standalone]


#32333

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-01-25 11:19 +0100
Message-ID<XnsA70873265DF02eejj99@194.109.6.166>
In reply to#32317
Cezary Tomczyk <cezary.tomczyk@gmail.com> wrote on 25 Jan 2017 in 
comp.lang.javascript:

> Me:
>> Methinks, Cezary, it is a quite marvelous idea for programmers who are
>> painfully aware of their own limitations in sofar as to add a "return
>> false;" at the end of their listener codes, their focus on focusability
>> rather being of another kind.
> 
> It's another kind, but still valuable.

You are too kind.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#32325

Frombit-naughty@hotmail.com
Date2017-01-24 23:00 -0800
Message-ID<18e749d1-3689-4f2d-8dd1-79b6ec4e5d3e@googlegroups.com>
In reply to#32310
On Tuesday, January 24, 2017 at 2:41:24 PM UTC-6, Cezary Tomczyk wrote:
> On 24/01/2017 19:27, Ram Tobolski wrote:
> >> And then how do you code the link?
> >
> > Hi. You don't need the link (<a>), just the <div>. You are registering a listener to clicks on the <div>
> 
> That's not a good idea as the <div> itself is not focusable and the user 
> will not be able to reach this button using keyboard. Except when you 
> add attribute tabindex="0", but I'd rather not use <div> with click 
> event instead use natively focusable <a> HTML element.


...and what would the code look like? <a href=something id=something> ? That doesn't look right...?

[toc] | [prev] | [next] | [standalone]


#32328

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2017-01-25 09:32 +0100
Message-ID<o69nqh$1pbj$1@csiph.com>
In reply to#32325
On 25/01/2017 08:00, bit-naughty@hotmail.com wrote:
> On Tuesday, January 24, 2017 at 2:41:24 PM UTC-6, Cezary Tomczyk wrote:
>> On 24/01/2017 19:27, Ram Tobolski wrote:
>>>> And then how do you code the link?
>>>
>>> Hi. You don't need the link (<a>), just the <div>. You are registering a listener to clicks on the <div>
>>
>> That's not a good idea as the <div> itself is not focusable and the user
>> will not be able to reach this button using keyboard. Except when you
>> add attribute tabindex="0", but I'd rather not use <div> with click
>> event instead use natively focusable <a> HTML element.
>
>
> ...and what would the code look like? <a href=something id=something> ? That doesn't look right...?

<a> should works fine. However, seems <a> here is meant to be a button 
so I think you can consider here to use <button> instead.

<button id="openPopUp">Open popup</button>

var openPopUpButton = document.getElementById('openPopUp');

function openPopUp(event) {
     if (typeof event.preventDefault === 'function') {
         event.preventDefault();
     }

     // Code that opens pop up here
}

openPopUpButton.addEventListener('click', openPopUp);

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/
https://www.aslint.org/ - Accessibility linting tool

[toc] | [prev] | [next] | [standalone]


#32340

Frombit-naughty@hotmail.com
Date2017-01-25 07:05 -0800
Message-ID<764c6a84-1342-4d2b-ac8a-3a78eab86b74@googlegroups.com>
In reply to#32328
On Wednesday, January 25, 2017 at 2:32:22 AM UTC-6, Cezary Tomczyk wrote:

> <a> should works fine. However, seems <a> here is meant to be a button 

No no - what the user will click on is a piece of text, like "Hello" - how do I do that? Do I just put it within a SPAN, with an id, or something??

[toc] | [prev] | [next] | [standalone]


#32364

Frombit-naughty@hotmail.com
Date2017-01-26 23:58 -0800
Message-ID<d5b9e1b9-4dd9-4ef8-8dc3-9b924fba73b5@googlegroups.com>
In reply to#32340
...so, Cezary? Do I put it within a SPAN?

[toc] | [prev] | [next] | [standalone]


#32375

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2017-01-27 12:48 +0100
Message-ID<o6fc2p$2emv$1@csiph.com>
In reply to#32364
On 27/01/2017 08:58, bit-naughty@hotmail.com wrote:
> ...so, Cezary? Do I put it within a SPAN?

If you have to. Just make sure that the user that uses keyboard will be 
able to reach this <span>.

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/
https://www.aslint.org/ - Accessibility linting tool

[toc] | [prev] | [next] | [standalone]


#32378

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2017-01-27 13:13 +0100
Message-ID<2544328.e9J7NaK4W3@PointedEars.de>
In reply to#32375
Cezary Tomczyk wrote:

> On 27/01/2017 08:58, bit-naughty@hotmail.com wrote:
>> […] Do I put it within a SPAN?
> 
> If you have to. Just make sure that the user that uses keyboard will be
> able to reach this <span>.

The simplest way to do this is to specify the “tabindex” attribute.  
However, that also interferes with normal Tab order.

See also:
<https://www.w3.org/TR/2016/REC-html51-20161101/editing.html#focus>

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#32326

Frombit-naughty@hotmail.com
Date2017-01-24 23:03 -0800
Message-ID<2615791b-1381-4a6e-a6b0-8e018578d26e@googlegroups.com>
In reply to#32310
On Tuesday, January 24, 2017 at 2:41:24 PM UTC-6, Cezary Tomczyk wrote:
 
> That's not a good idea as the <div> itself is not focusable and the user 
> will not be able to reach this button using keyboard. Except when you 
> add attribute tabindex="0", but I'd rather not use <div> with click 
> event instead use natively focusable <a> HTML element.


Oh - and what's "tabindex"???

[toc] | [prev] | [next] | [standalone]


#32334

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-01-25 11:21 +0100
Message-ID<XnsA70873890B36Eeejj99@194.109.6.166>
In reply to#32326
bit-naughty@hotmail.com wrote on 25 Jan 2017 in comp.lang.javascript:

> On Tuesday, January 24, 2017 at 2:41:24 PM UTC-6, Cezary Tomczyk wrote:
>  
>> That's not a good idea as the <div> itself is not focusable and the user 
>> will not be able to reach this button using keyboard. Except when you 
>> add attribute tabindex="0", but I'd rather not use <div> with click 
>> event instead use natively focusable <a> HTML element.
> 
> 
> Oh - and what's "tabindex"???

Damn, do we nead to learn you to google?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#32341

Frombit-naughty@hotmail.com
Date2017-01-25 07:10 -0800
Message-ID<ef181e02-b5cd-419b-8a5b-048adc81fe06@googlegroups.com>
In reply to#32334
On Wednesday, January 25, 2017 at 4:21:30 AM UTC-6, Evertjan. wrote:

> 
> Damn, do we nead to learn you to google?

For God's sake, I've told you before, SHUT THE FUCK UP already.

[toc] | [prev] | [next] | [standalone]


#32343

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-01-25 17:42 +0100
Message-ID<XnsA708B42F0E797eejj99@194.109.6.166>
In reply to#32341
bit-naughty@hotmail.com wrote on 25 Jan 2017 in comp.lang.javascript:

> On Wednesday, January 25, 2017 at 4:21:30 AM UTC-6, Evertjan. wrote:
> 
>> 
>> Damn, do we nead to learn you to google?

'need'
 
> For God's sake, 

Your god perhaps.

> I've told you before,

So?

> SHUT THE FUCK UP already.

Is this English?

==========

> > > Oh - and what's "tabindex"???

Why, please, do you think we should explain to you what tabindex is,
while the answer is plainly to be learned by a simple google seach.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.javascript


csiph-web