These are chat archives for canjs/canjs

20th
Sep 2018
Viktor Busko
@Lighttree
Sep 20 2018 08:58
events: {
        '.showMore enter': function (...args) {
            console.log('enter', args);
        },

        '.showMore click': function (...args) {
            console.log('click', args);
        }
    }
In this example Enter key press calls click as well. Is there way to avoid this ? Isn't this a bug ?
Jeroen Cornelissen
@jeroencornelissen
Sep 20 2018 09:02
@Lighttree I think that’s just browser behaviour. If a <button> is focused you can press enter or space key and that will trigger the click event.
Do you need the .showMore enter event?
Viktor Busko
@Lighttree
Sep 20 2018 09:04

yeah this obvious, I was thinking that this "special" enter event split internally mouse click and keyboard enter event.

Do you need the .showMore enter event?

Yes, I need slightly different behavior depends user use keyboard or mouse.

I probably can use just click and verify source internally
Viktor Busko
@Lighttree
Sep 20 2018 09:24
Marc Godard
@MarcGodard
Sep 20 2018 21:54
is there a way in a helper to know if it used {{{...}}} or {{...}}?