-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: add KeyboardMixin and make other mixins use it #2432
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
web-padawan
reviewed
Sep 2, 2021
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
vursen
force-pushed
the
feat/keyboard-mixin
branch
from
September 2, 2021 14:10
9b317c6
to
723e5bf
Compare
vursen
force-pushed
the
feat/keyboard-mixin
branch
from
September 2, 2021 14:11
723e5bf
to
d5ea194
Compare
web-padawan
changed the title
feat: add KeyboardMixin
feat: add KeyboardMixin and make other mixins use it
Sep 2, 2021
web-padawan
approved these changes
Sep 2, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This ticket/PR has been released with platform 22.0.0.alpha3 and is also targeting the upcoming stable 22.0.0 version. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
ActiveMixin
,ClearButtonMixin
and futureCheckedMixin
all need to handle thekeyup
andkeydown
events.Along with that, the prototype of the new Checkbox component supposes it to inherit both
ActiveMixin
andCheckedMixin
. This being so, these mixins will end up in the same scope and there may happen a naming collision (in case both define a_onKeyDown
method, for example).So it was decided to introduce
KeyboardMixin
that is responsible for subscribing to the keyboard events while leaving actual implementation of the event handlers to the client (a component or another mixin).See the prototype: https://github.com/vaadin/component-mixins/blob/master/packages/keyboard-mixin/keyboard-mixin.ts
Part of #2210.
Type of change
Checklist