Answers for "components key events gutenberg"

0

components key events gutenberg

import { KeyboardShortcuts } from '@wordpress/components';
import { withState } from '@wordpress/compose';
 
const MyKeyboardShortcuts = withState( {
    isAllSelected: false,
} )( ( { isAllSelected, setState } ) => { 
    const selectAll = () => {
        setState( { isAllSelected: true } )
    };
 
    return (
        <div>
            <KeyboardShortcuts shortcuts={ {
                'mod+a': selectAll,
            } } />
            [cmd/ctrl + A] Combination pressed? { isAllSelected ? 'Yes' : 'No' }
        </div>
    ) 
} )
Posted by: Guest on July-14-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language