omridevk / ng-keyboard-shortcuts

Dead Simple Keyboard Shortcuts Management for Angular
https://ng-keyboard-shortcuts.vercel.app/
147 stars 34 forks source link

cmd + b Not Working #19

Closed sidikhanrei closed 5 years ago

sidikhanrei commented 5 years ago

I was try this plugins and work for some combinations. But when I tried cmd / ctrl + b is not working

omridevk commented 5 years ago

see working example here: https://codesandbox.io/s/ngkeyboardshortcuts-example-t8h4j

omridevk commented 5 years ago

Please provide a codesandbox example demonstrating the issue as I cannot reproduce. And Thanks for reporting it in the first place :)

omridevk commented 5 years ago

Feel free to re-open if issue persist.

sidikhanrei commented 5 years ago

Please have a look at console. No feedback for command: e => console.log(e),

it is not responding to ctrl + b

image

omridevk commented 5 years ago

Which operating system are you using? Thanks

sidikhanrei commented 5 years ago

Which operating system are you using? Thanks

I am using Win 10

omridevk commented 5 years ago

@sidikhanrei Sorry, should have asked all of these questions in the first place: Desktop (please complete the following information):

OS: Windows 10 Browser [e.g. chrome, safari] Version [e.g. 22]

Thanks, sorry for the back and forth on this.

sidikhanrei commented 5 years ago

@omridevk

OS: Windows 10 Browser: Chrome Version: 74.0.3729.157 (Official Build) (64-bit)

I've tested on Firefox and its not working too.

Thank you for your response

sidikhanrei commented 5 years ago

This is my code,

this.shortcuts.push(
            {
                key: ["cmd + b"],
                allowIn: [AllowIn.Textarea, AllowIn.Input],
                command: e => console.log(e),
                preventDefault: true
            },
            {
                key: ["cmd + i"],
                allowIn: [AllowIn.Textarea, AllowIn.Input],
                command: e => {
                    this.FormatText('i');
                },
                preventDefault: true
            },
            {
                key: ["cmd + s"],
                allowIn: [AllowIn.Textarea, AllowIn.Input],
                command: e => {
                    this.FormatText('s');
                },
                preventDefault: true
            },
            {
                key: ["cmd + e"],
                allowIn: [AllowIn.Textarea, AllowIn.Input],
                command: e => {
                    if (this.EmojiShown && this.EmojiCanHide) {
                        this.HideEmoji();
                    }else{
                        this.ShowEmoji();
                    }
                },
                preventDefault: true
            }
        );
omridevk commented 5 years ago

@sidikhanrei I am having hard time reproducing the issue, when I go to the following sandbox: https://codesandbox.io/s/ngkeyboardshortcuts-example-iv7ow I do see output in the console. tested both in Windows 10 with Chrome Version 74.0.3729.157 (Official Build) (64-bit) and Firefox. Also tested in Mac with Chrome and Firefox, and seems to be working as expected.

Can you please the enter following gitter channel I created: https://gitter.im/ng-keyboard-shortcuts/community# I would like to further investigate the issue with you if you don't mind.

sidikhanrei commented 5 years ago

It would be my pleasure

omridevk commented 5 years ago

Closing the issue. The issue was resolved in the gitter thread: https://gitter.im/ng-keyboard-shortcuts/community# Basically, a collision between electron key binding and angular. Thanks @sidikhanrei for reporting and helping resolving the issue.

sidikhanrei commented 5 years ago

It's perfectly working now.

Thank you so much @omridevk it's not issue with your plugins. Your plugins seem overided by some code of my electron.

Its fix now and work like a charm