ember-key-manager icon indicating copy to clipboard operation
ember-key-manager copied to clipboard

Uncaught TypeError: Cannot read property 'toLowerCase' of null

Open gossi opened this issue 7 years ago • 3 comments

I do get this error with v0.3.0, the mentioned line is:

https://github.com/IcarusWorks/ember-key-manager/blob/dc0db287261c49ef09d6077200a5fe6d7d48da8d/addon/services/key-manager.js#L161

gossi avatar Jan 28 '18 00:01 gossi

I was looping over my user defined hotkeys:

macros.push(manager.addMacro({
	executionKey: node.get('hotkey'),
	keyEvent: 'keydown',
	callback: () => {
		// ...
	}
}));

Some nodes didn't had a hotkey and most likely had null registering, should be prevent by an error message, I guess?

gossi avatar Jan 28 '18 00:01 gossi

👍 on a warning message if no 'executionKey' is specified.

jordpo avatar Jan 29 '18 19:01 jordpo

@gossi do you want to take a stab at it and follow the same pattern that we did here? https://github.com/IcarusWorks/ember-key-manager/blob/master/addon/services/key-manager.js#L61

jordpo avatar Jan 29 '18 19:01 jordpo