Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add container to textarea to resolve style issues and add padding to input to match #253

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

ynotdraw
Copy link
Contributor

@ynotdraw ynotdraw commented Aug 9, 2023

🚀 Description

  • Adjusts the input padding to match the designs
  • Adds a container around textarea so that the drag handle and long text does not collide with the focus and focus+error shadows.
    • NOTE: This padding now matches input as well (px-2). Autocomplete and Multiselect already had these classes specified, so now everything is consistent 🎉

🔬 How to Test


📸 Images/Videos of Functionality

BEFORE AFTER
Screenshot 2023-08-10 at 7 47 32 AM Screenshot 2023-08-10 at 8 04 42 AM
Notice that the shadow collides with the text content and resize handle Notice shadow and resize handle no longer collides
Screenshot 2023-08-10 at 8 05 48 AM Screenshot 2023-08-10 at 8 05 27 AM
No internal padding Padding now matches designs

@ynotdraw ynotdraw self-assigned this Aug 9, 2023
@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2023

🦋 Changeset detected

Latest commit: c18922f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@crowdstrike/ember-toucan-core Minor
@crowdstrike/ember-toucan-form Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

Preview URLs

Env: preview
Docs: https://94b934d0.ember-toucan-core.pages.dev

@@ -44,14 +44,14 @@ export default class ToucanFormTextareaControlComponent extends Component<Toucan
}

if (isReadOnly) {
return 'focus:shadow-focus-outline bg-surface-xl shadow-read-only-outline text-titles-and-attributes';
return 'focus-within:shadow-focus-outline bg-surface-xl shadow-read-only-outline text-titles-and-attributes';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to switch to focus-within due to using a container now

@@ -158,7 +158,6 @@ export default class ToucanFormInputFieldComponent extends Component<ToucanFormI
field.errorId
}}"
aria-invalid={{if @error "true"}}
class="w-full"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controls now specify w-full so this isn't needed anymore

@@ -19,17 +19,17 @@ module('Integration | Component | Fields | Textarea', function (hooks) {
assert
.dom('[data-hint]')
.doesNotExist(
'Expected hint block not to be displayed as a hint was not provided'
'Expected hint block not to be displayed as a hint was not provided',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently some post-prettier-v3-upgrade formatting that was missed 🤷

Comment on lines +2 to +4
<div class='w-96'>
<Form::Controls::Input />
</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are now full-width by default, adding the container with the fixed width so they don't look ridiculous 😂

@ynotdraw ynotdraw changed the title fix: Add container to textarea to resolve style issues fix: Add container to textarea to resolve style issues and add padding to input to match Aug 10, 2023
@ynotdraw ynotdraw merged commit 24df01b into main Aug 14, 2023
14 checks passed
@ynotdraw ynotdraw deleted the textarea-w-full-fix branch August 14, 2023 20:01
@github-actions github-actions bot mentioned this pull request Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants