Skip to content

Commit

Permalink
refactor: update shared onCancel type for EuiInlineEdit components
Browse files Browse the repository at this point in the history
- allow usage also when not used as controlled component since the cancel action is always present
  • Loading branch information
mgadewoll committed Feb 4, 2025
1 parent 10f853d commit e460ff8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/eui/src/components/inline_edit/inline_edit_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export type EuiInlineEditCommonProps = Omit<
* Initial inline edit text value
*/
defaultValue: string;
onCancel?: (perviousValue: string) => void;
},
{
/**
Expand All @@ -107,7 +108,7 @@ export type EuiInlineEditCommonProps = Omit<
*/
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
/**
* Callback required to reset `value` to the previous read mode text value.
* Callback to reset `value` to the previous read mode text value
*/
onCancel: (perviousValue: string) => void;
}
Expand Down

0 comments on commit e460ff8

Please sign in to comment.