Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Fixes conflicting keyCode for comma #335

Closed
wants to merge 2 commits into from

Conversation

bezoerb
Copy link

@bezoerb bezoerb commented Jan 15, 2015

Added additional helper method to validate comma so a new tag won't be created when pressing <
(#334)

@bezoerb bezoerb changed the title Fixes conflicting keyCode 188 (#334) Fixes conflicting keyCode for comma Jan 15, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 5af5433 on bezoerb:patch-addOnComma into b812a44 on mbenford:master.

@bezoerb
Copy link
Author

bezoerb commented Feb 12, 2015

@mbenford any updates on this?

*/
function validateComma(e) {
var originalEvent = e.originalEvent || e;
return (e.keyCode !== KEYS.comma) || (e.key || e.char) === ',' || originalEvent.keyIdentifier === 'U+002C';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be simpler to just check if any key modifier is activated?

* FF: key
* IE: char|key
* Safari: -
*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only properties that differ between pressing < and , so i think there's no other way to fix this.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.29%) to 100.0% when pulling 9da024b on bezoerb:patch-addOnComma into b812a44 on mbenford:master.

@hrangel
Copy link

hrangel commented Aug 1, 2016

Up to this! Can it be merged?

@bezoerb bezoerb closed this Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants