From 1da99002f87f18458d356ca614dfae282ba49d3e Mon Sep 17 00:00:00 2001 From: artemtrusov-cengage Date: Fri, 4 Oct 2024 22:14:19 +0200 Subject: [PATCH] fix(search): Fix the overlapping content issue around the clear button (#1474) --- .changeset/search-clear-overlaps.md | 5 +++++ packages/react-magma-dom/src/components/InputBase/index.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/search-clear-overlaps.md diff --git a/.changeset/search-clear-overlaps.md b/.changeset/search-clear-overlaps.md new file mode 100644 index 000000000..422457f13 --- /dev/null +++ b/.changeset/search-clear-overlaps.md @@ -0,0 +1,5 @@ +--- +'react-magma-dom': patch +--- + +fix(search): Fix the overlapping content issue around the clear button diff --git a/packages/react-magma-dom/src/components/InputBase/index.tsx b/packages/react-magma-dom/src/components/InputBase/index.tsx index 4af99eba4..ec46be3cd 100644 --- a/packages/react-magma-dom/src/components/InputBase/index.tsx +++ b/packages/react-magma-dom/src/components/InputBase/index.tsx @@ -686,7 +686,9 @@ export const InputBase = React.forwardRef( iconPosition={iconPosition} inputSize={inputSize ? inputSize : InputSize.medium} isClearable={ - inputWrapperStyle?.width + type === InputType.search + ? isClearable + : inputWrapperStyle?.width ? isClearable : isClearable && inputLength > 0 }