Skip to content

Commit 09ae797

Browse files
committed
fix: apply withIgnoreIMEEvents to key down
Manual testing with IMEs showed that the HOF can safely be applied just to the key down events
1 parent ee6c42e commit 09ae797

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/block-library/src/details/edit.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
ToggleControl,
1414
__experimentalToolsPanel as ToolsPanel,
1515
__experimentalToolsPanelItem as ToolsPanelItem,
16+
privateApis as componentsPrivateApis,
1617
} from '@wordpress/components';
1718
import { __ } from '@wordpress/i18n';
1819
import { useState } from '@wordpress/element';
@@ -22,6 +23,9 @@ import { useSelect } from '@wordpress/data';
2223
* Internal dependencies
2324
*/
2425
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
26+
import { unlock } from '../lock-unlock';
27+
28+
const { withIgnoreIMEEvents } = unlock( componentsPrivateApis );
2529

2630
const TEMPLATE = [
2731
[
@@ -120,7 +124,7 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
120124
onToggle={ ( event ) => setIsOpen( event.target.open ) }
121125
>
122126
<summary
123-
onKeyDown={ handleSummaryKeyDown }
127+
onKeyDown={ withIgnoreIMEEvents( handleSummaryKeyDown ) }
124128
onKeyUp={ handleSummaryKeyUp }
125129
>
126130
<RichText

packages/components/src/private-apis.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ComponentsContext } from './context/context-system-provider';
77
import Theme from './theme';
88
import { Tabs } from './tabs';
99
import { kebabCase } from './utils/strings';
10+
import { withIgnoreIMEEvents } from './utils/with-ignore-ime-events';
1011
import { lock } from './lock-unlock';
1112
import Badge from './badge';
1213

@@ -18,5 +19,6 @@ lock( privateApis, {
1819
Theme,
1920
Menu,
2021
kebabCase,
22+
withIgnoreIMEEvents,
2123
Badge,
2224
} );

0 commit comments

Comments
 (0)