Skip to content

Commit

Permalink
[MX] Break line of custom field value when it is too long (elastic#19…
Browse files Browse the repository at this point in the history
…0490)

Issue: elastic#189076

If you paste a long text in a text custom field you cannot edit it. The
pencil is not visible anymore.
![Screenshot 2024-08-14 at 17 39
51](https://github.com/user-attachments/assets/e6f23843-9b79-4b6f-b4c1-464fbd04ebe0)

Used `.eui-textBreakWord` class to solve the issue

How to test:
1. Create a custom field for cases with really long test (but less than
160 symbols)
2. Create a case
3. See that the test is breaked.

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
guskovaue and kibanamachine authored Aug 15, 2024
1 parent 0a29b68 commit 74c9570
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ import type { CustomFieldType } from '../types';
const ViewComponent: CustomFieldType<CaseCustomFieldText>['View'] = ({ customField }) => {
const value = customField?.value ?? '-';

return <EuiText data-test-subj={`text-custom-field-view-${customField?.key}`}>{value}</EuiText>;
return (
<EuiText
className="eui-textBreakWord"
data-test-subj={`text-custom-field-view-${customField?.key}`}
>
{value}
</EuiText>
);
};

ViewComponent.displayName = 'View';
Expand Down

0 comments on commit 74c9570

Please sign in to comment.