Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
104 stars 32 forks source link

Add `TextAreaE` #2492

Closed thyhjwb6 closed 2 years ago

thyhjwb6 commented 2 years ago

Related issue

2432

Overview

Copies the existing TextArea to TextAreaE and updates styling.

Link to preview

https://pr-2492.netlify.app/?path=/story/text-area-experimental--default

Reason

The Text area component allows users to enter new or edit existing multiple lines of text.

Work carried out

Screenshot

Chrome

chrome

ie11

ie11

k9dh3zij commented 2 years ago

Thanks! Here's my feedback:

  1. User input should not be visible behind/above the input label image

  2. Label and user input font sizes should match those of Text Field. Currently:

    • Default label size is too big
    • User input colour should be Neutral 600

From the spec:

Label (Default) Font: Lato Regular Colour: #3e5667 (Neutral 400) Size: 16px

Label (Filled) Font: Lato Regular Colour: #3e5667 (Neutral 400) Size: 12px

User input Font: Lato Regular Colour: #1c2d39 (Neutral 600) Size: 16px

  1. The resize handle is slightly misaligned:

Current: image

Design: image

  1. In the screenshot above, the resize handle seems to be missing in IE11?
thyhjwb6 commented 2 years ago

User input should not be visible behind/above the input label

Although I agree this is an issue, it is the situation with the existing TextArea. My suggestion is that we create a separate ticket as there is complexity.

2.

👍

The resize handle is slightly misaligned

Glad you noticed this. Our options for providing spacing at the bottom of the textarea are limited. My suggestion is that we remove this which fixes the misalignment and we create a separate ticket for adding spacing.

In the screenshot above, the resize handle seems to be missing in IE11?

It is not a feature in IE. Again we can add a ticket to introduce something although the work will be considerable vs the gain.

Updated screenshot

Chrome

2021-06-29 15 19 50

ie11

Screenshot 2021-06-29 at 15 58 00

k9dh3zij commented 2 years ago

@hxltrhuxze Can you have a look at # 1, 3 and 4 above please, to make a decision on what is worth the effort?

@thyhjwb6 Cheers, I can confirm # 2 has been resolved.

Just noticed one more: if I type some text that exceeds the vertical height, the scrollbar overlaps the borders.
This is also an issue with the existing component, but the rounded corners exacerbate it here.

If we can't style the scrollbar corners, is it worth making the actual text area slightly smaller? This could also address issue # 1, with the text scrolling behind the input label?

image image

hxltrhuxze commented 2 years ago

Had a look through this PR and these are my recommendations:

  1. We should fix this. padding-top should be set to the parent <div> instead of the textarea itself. This will mean no textarea text can clip behind the label.

  2. I think the best we're going to get is having the right-hand side padded so that the scrollbar sits within the textarea. I'm not sure we have much alternative aside from reducing the border-radius across all the components. @k9dh3zij this will be one for you to decide from a design perspective. If we can find a nice solution though, we should fix this.

\4. Too much effort right now. Let's leave it until we have a request for it and then we can make a decision about priorities.

thyhjwb6 commented 2 years ago

Thank you for the feedback @k9dh3zij and @hxltrhuxze.

All changes have been applied except 4 which we will keep our eye on.

2021-06-30 15 51 03

k9dh3zij commented 2 years ago

The new padding addresses # 1, 5 and also looks ok for # 3. Leaving # 4 as is as per comment above, until we get a request to fix.

All OK from my side, thank you @thyhjwb6 :)

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

94.8% 94.8% Coverage
0.0% 0.0% Duplication