-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Implement roving tabindex on the header toolbar #22354
Changes from all commits
fdbba33
8ca8540
2cd9f8c
f4aabc9
ffa948b
9ae1761
d18eeaf
a759470
47a9bcb
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 |
---|---|---|
|
@@ -7,10 +7,13 @@ import { withSelect, withDispatch } from '@wordpress/data'; | |
import { compose } from '@wordpress/compose'; | ||
import { displayShortcut } from '@wordpress/keycodes'; | ||
import { redo as redoIcon } from '@wordpress/icons'; | ||
import { forwardRef } from '@wordpress/element'; | ||
|
||
function EditorHistoryRedo( { hasRedo, redo } ) { | ||
function EditorHistoryRedo( { hasRedo, redo, innerRef, ...props } ) { | ||
return ( | ||
<Button | ||
{ ...props } | ||
ref={ innerRef } | ||
icon={ redoIcon } | ||
label={ __( 'Redo' ) } | ||
shortcut={ displayShortcut.primaryShift( 'z' ) } | ||
|
@@ -24,11 +27,15 @@ function EditorHistoryRedo( { hasRedo, redo } ) { | |
); | ||
} | ||
|
||
export default compose( [ | ||
const EnhancedEditorHistoryRedo = compose( [ | ||
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. Have you considered refactoring this and other similar components ( 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. I haven't played with 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. Sure thing👍 |
||
withSelect( ( select ) => ( { | ||
hasRedo: select( 'core/editor' ).hasEditorRedo(), | ||
} ) ), | ||
withDispatch( ( dispatch ) => ( { | ||
redo: dispatch( 'core/editor' ).redo, | ||
} ) ), | ||
] )( EditorHistoryRedo ); | ||
|
||
export default forwardRef( ( props, ref ) => ( | ||
<EnhancedEditorHistoryRedo { ...props } innerRef={ ref } /> | ||
) ); |
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.
I think at some point we need to introduce consistency to our components. Some of them use "tagName", others "as". We kind maybe move to "as" as a bit nicer while maintaining fallbacks for BC.