-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Refactor keycode exporting in ui_framework #13663
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
export const ENTER_KEY = 13; | ||
export const SPACE_KEY = 32; | ||
import { ENTER, SPACE } from '../key_codes'; | ||
|
||
// These keys are used to execute click actions on interactive elements like buttons and links. | ||
export const accessibleClickKeys = { | ||
[ENTER_KEY]: 'enter', | ||
[SPACE_KEY]: 'space', | ||
[ENTER]: 'enter', | ||
[SPACE]: 'space', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
export { | ||
accessibleClickKeys, | ||
ENTER_KEY, | ||
SPACE_KEY, | ||
} from './accessible_click_keys'; | ||
|
||
export { accessibleClickKeys } from './accessible_click_keys'; | ||
export { comboBoxKeyCodes } from './combo_box_key_codes'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
// Export all keyCodes under a `keyCodes` named variable | ||
import * as keyCodes from './key_codes'; | ||
export { keyCodes }; | ||
|
||
export { | ||
accessibleClickKeys, | ||
comboBoxKeyCodes, | ||
ENTER_KEY, | ||
SPACE_KEY, | ||
} from './accessibility'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats the difference between ENTER_KEY from accessibility and keycodes.ENTER? Above you are importing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Honestly I just refactored the |
||
|
||
export { SortableProperties } from './sort'; | ||
export { ESC_KEY_CODE } from './key_codes'; | ||
|
||
export { LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from './alignment'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
export const DOWN_KEY_CODE = 40; | ||
export const ENTER_KEY_CODE = 13; | ||
export const ESC_KEY_CODE = 27; | ||
export const TAB_KEY_CODE = 9; | ||
export const UP_KEY_CODE = 38; | ||
export const ENTER = 13; | ||
export const SPACE = 32; | ||
export const ESCAPE = 27; | ||
export const TAB = 9; | ||
|
||
// Arrow keys | ||
export const DOWN = 40; | ||
export const UP = 38; |
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.
We need to replace the custom
keyCodes
instance here withimport { keyCodes } from 'ui_framework/services';