# How to prevent Enter key from toggling the ExpansionPanel

## Environment

<table>
	<tbody>
		<tr>
			<td>Product Version</td>
			<td>12.2.0</td>
		</tr>
		<tr>
			<td>Product</td>
			<td>Progress® KendoReact ExpansionPanel</td>
		</tr>
	</tbody>
</table>

## Description

I want to prevent the Enter key from toggling the ExpansionPanel. By default, when the ExpansionPanel is focused and the user presses Enter, it expands or collapses. I want to disable this behavior.

## Solution

The ExpansionPanel triggers the [onAction](https://www.telerik.com/kendo-react-ui/components/layout/api/expansionpanelprops#onaction) event when the panel is toggled. By accessing the `syntheticEvent` within the event handler, you can check if the Enter key was pressed and prevent the default behavior.

This is an example showcasing this in action:

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/layout/expansion-panel-prevent-enter/source.txt)

## See Also

* [ExpansionPanel Overview](https://www.telerik.com/kendo-react-ui/components/layout/expansionpanel)
* [ExpansionPanel API](https://www.telerik.com/kendo-react-ui/components/layout/api/expansionpanelprops)
