Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions packages/react-native-aztec/src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,6 @@ class AztecView extends Component {
const RCTAztecView = requireNativeComponent( 'RCTAztecView', AztecView );

AztecView.InputState = AztecInputState;
AztecView.KeyCodes = KEYCODES;

export default AztecView;
1 change: 1 addition & 0 deletions packages/rich-text/src/component/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export class RichText extends Component {
this.customEditableOnKeyDown?.( {
preventDefault: () => undefined,
...event,
key: RCTAztecView.KeyCodes[ event?.keyCode ],
} );

this.handleDelete( event );
Expand Down
5 changes: 4 additions & 1 deletion test/native/__mocks__/@wordpress/react-native-aztec/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { omit } from 'lodash';
*/
import { forwardRef, useImperativeHandle, useRef } from '@wordpress/element';

// Preserve the mock of AztecInputState to be exported with the AztecView mock.
// Preserve the mock of AztecInputState and AztecKeyCodes to be exported with the AztecView mock.
const AztecInputState = jest.requireActual( '@wordpress/react-native-aztec' )
.default.InputState;
const AztecKeyCodes = jest.requireActual( '@wordpress/react-native-aztec' )
.default.KeyCodes;

const UNSUPPORTED_PROPS = [ 'style' ];

Expand Down Expand Up @@ -50,5 +52,6 @@ const RCTAztecView = ( { accessibilityLabel, text, ...rest }, ref ) => {

const AztecView = forwardRef( RCTAztecView );
AztecView.InputState = AztecInputState;
AztecView.KeyCodes = AztecKeyCodes;

export default AztecView;