From 2b62bf48412fb98c0b122e035222e8cfa7873b07 Mon Sep 17 00:00:00 2001 From: kate-deriv <121025168+kate-deriv@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:18:07 +0300 Subject: [PATCH 01/63] Kate / OPT-328 / Responsive: tooltips for Take profit get cut off (#9964) * fix: remove extra warning from mobile * refactor: applied existing logic --- .../components/src/components/input-field/input-field.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/input-field/input-field.tsx b/packages/components/src/components/input-field/input-field.tsx index 94296b7c1663..a7b60b333d7c 100644 --- a/packages/components/src/components/input-field/input-field.tsx +++ b/packages/components/src/components/input-field/input-field.tsx @@ -122,7 +122,7 @@ const InputField = ({ }: TInputField) => { const [local_value, setLocalValue] = React.useState(); const Icon = icon as React.ElementType; - const has_error = error_messages && !!error_messages.length; + const has_error = error_messages && !!error_messages.length && !is_error_tooltip_hidden; const max_is_disabled = max_value && (+value >= +max_value || Number(local_value) >= +max_value); const min_is_disabled = min_value && (+value <= +min_value || Number(local_value) <= +min_value); let has_valid_length = true; @@ -304,7 +304,7 @@ const InputField = ({ is_increment_input ? 'dc-input-wrapper__input' : '', inline_prefix ? 'input--has-inline-prefix' : '', 'input', - { 'input--error': has_error }, + { 'input--error': error_messages && !!error_messages.length }, classNameInput )} classNameDynamicSuffix={classNameDynamicSuffix} @@ -355,7 +355,7 @@ const InputField = ({ className={classNames('trade-container__tooltip', { 'dc-tooltip--with-label': label })} alignment={error_message_alignment || 'left'} message={has_error ? error_messages[0] : null} - has_error={!is_error_tooltip_hidden && has_error} + has_error={has_error} > {!!label && (