File tree Expand file tree Collapse file tree
packages/core/src/components/EditableTypography Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ export interface EditableTypographyImplementationProps {
2424 * Callback fired when the component is clicked.
2525 */
2626 onClick ?: ( event : React . KeyboardEvent | React . MouseEvent ) => void ;
27+ /**
28+ * Callback fired when a key is pressed inside the input/textarea element.
29+ */
30+ onKeyDown ?: ( event : React . KeyboardEvent < HTMLInputElement | HTMLTextAreaElement > ) => void ;
2731 /**
2832 * If true, the text is read-only and cannot be edited.
2933 */
@@ -92,6 +96,7 @@ const EditableTypography = forwardRef(
9296 value,
9397 onChange,
9498 onClick,
99+ onKeyDown,
95100 readOnly = false ,
96101 ariaLabel = "" ,
97102 placeholder,
@@ -187,6 +192,8 @@ const EditableTypography = forwardRef(
187192 handleEditModeChange ( false ) ;
188193 setInputValue ( value ) ;
189194 }
195+
196+ onKeyDown ?.( event ) ;
190197 }
191198
192199 function handleChange ( event : React . ChangeEvent < HTMLInputElement | HTMLTextAreaElement > ) {
You can’t perform that action at this time.
0 commit comments