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

Comments

Projects
None yet
2 participants
@omissis
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@baptistedonaux

baptistedonaux Nov 23, 2016

Contributor

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
});
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@omissis

omissis Nov 23, 2016

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@omissis

omissis Nov 23, 2016

Contributor

@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)

Contributor

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