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

feat(keyboard-keys): Export keys and legacy keyCodes #18896

Merged
merged 4 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove deep export
  • Loading branch information
ling1726 committed Jul 14, 2021
commit 4daf8550057b82fd01597582a01ba919b3981dc2
6 changes: 3 additions & 3 deletions packages/keyboard-keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ is not encouraged for reuse since this propoerty has been deprecated for a while
standards.

```ts
import { Enter, a } from '@fluentui/keyboard-keys/lib/keyCodes';
import { keyCodes } from '@fluentui/keyboard-keys';

const onKeyDown = (e: React.KeyboardEvent) => {
if (e.keyCode === Enter) {
if (e.keyCode === keyCodes.Enter) {
// ...
}

if (e.key === a) {
if (e.key === keyCodes.a) {
// ...
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/keyboard-keys/bundle-size/MultipleKeys.fixture.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Enter, Tab, ArrowDown, ArrowLeft, ArrowRight } from '@fluentui/keyboard-keys';
import { keyCodes } from '@fluentui/keyboard-keys';

console.log(Enter, Tab, ArrowDown, ArrowLeft, ArrowRight);
console.log(keyCodes.Enter, keyCodes.Tab, keyCodes.ArrowDown, keyCodes.ArrowLeft, keyCodes.ArrowRight);

export default {
name: 'Multiple keys',
Expand Down
4 changes: 2 additions & 2 deletions packages/keyboard-keys/bundle-size/SingleKeyCode.fixture.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Enter } from '@fluentui/keyboard-keys/lib/keyCodes';
import { keyCodes } from '@fluentui/keyboard-keys';

console.log(Enter);
console.log(keyCodes.Enter);

export default {
name: 'Single keyCode',
Expand Down
Loading