Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring KeyBoard Mappings #34

Closed
omissis opened this issue Nov 21, 2016 · 3 comments
Closed

Configuring KeyBoard Mappings #34

omissis opened this issue Nov 21, 2016 · 3 comments

Comments

@omissis
Copy link
Contributor

@omissis omissis commented Nov 21, 2016

It would be nice to be able to customize Keyboard Mappings to implement more advanced behaviours and modify existing ones. For example I can't see a way to bind the ESC key that doesn't require some heavy hacking with the internals.

Any thoughts/suggestions?

@baptistedonaux
Copy link
Contributor

@baptistedonaux baptistedonaux commented Nov 23, 2016

There is KeyboardMappings option (which isn't describe in the documentation 😞).

I think you can merge the default configuration with your custom mapping.

var mapping = Object.assign(AutoComplete.defaults.KeyboardMappings, {
    "ESC": {}
});

AutoComplete({
    KeyboardMappings: mapping
});
@omissis
Copy link
Contributor Author

@omissis omissis commented Nov 23, 2016

ah that's cool, thanks. I'll try that and see if I can add that to the docs :)

@omissis omissis closed this Nov 23, 2016
@omissis
Copy link
Contributor Author

@omissis omissis commented Nov 23, 2016

@baptistedonaux ok the suggestion works, with the only issue that ConditionOperator is not exposed, so it's not possible to use it as in the core definitions. Since my use case is rather simple, I managed to add it anyway, but it should probably be fixed. Should I open a ticket for that? (Maybe I will also manage to push a PR, but that'll take some more time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.