From eeaf0688b392d86ced78bbdee7578e3fb74e35c6 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 10 Oct 2024 20:19:21 +0000 Subject: [PATCH] fix(text-field-search): make className and endOfAccessory optional --- .../text-field-search/deprecated/text-field-search.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/components/component-library/text-field-search/deprecated/text-field-search.js b/ui/components/component-library/text-field-search/deprecated/text-field-search.js index c23e2af157e2..24198b95e54d 100644 --- a/ui/components/component-library/text-field-search/deprecated/text-field-search.js +++ b/ui/components/component-library/text-field-search/deprecated/text-field-search.js @@ -19,11 +19,11 @@ import { useI18nContext } from '../../../../hooks/useI18nContext'; */ export const TextFieldSearch = ({ - className, + className = '', showClearButton = true, // only works with a controlled input clearButtonOnClick, clearButtonProps, - endAccessory, + endAccessory = null, inputProps, value, onChange, @@ -108,11 +108,16 @@ TextFieldSearch.propTypes = { /** * Component to appear on the right side of the input */ - endAccessory: PropTypes.node, + endAccessory: PropTypes.oneOfType([PropTypes.node, PropTypes.any]), /** * Attributes applied to the `input` element. */ inputProps: PropTypes.object, }; +TextFieldSearch.defaultProps = { + className: '', + endAccessory: null, +}; + TextFieldSearch.displayName = 'TextFieldSearch';