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

feat: Allow positional placement of endSlot in TextField #899

Merged
merged 6 commits into from
Mar 12, 2025

Conversation

scottlovegrove
Copy link
Contributor

Short description

This change allows us to use the bordered variant of TextField and have the endSlot appear centrally, rather than inline with the input at the bottom.

Before:
image

After (with endSlotPosition set to fullHeight:
image

I know Design would like this to be the default behaviour, but given I only need it for one area in the app (new onboarding), I was reluctant to make my changes the default behaviour, so I haven't. This is opt-in, rather than opt-out.

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (storybooks, readme)
  • Reviewed and approved Chromatic visual regression tests in CI

@scottlovegrove scottlovegrove self-assigned this Mar 12, 2025
@engfragui
Copy link
Contributor

engfragui commented Mar 12, 2025

variant: bordered + some endSlot passed in -> I would expect the endSlot to show up regardless of the value of endSlotPosition (even if it's undefined), right? 🤔 (I mean, it should just take the default value for endSlotPosition)

Screenshot 2025-03-12 at 15 59 13

@engfragui
Copy link
Contributor

@scottlovegrove I feel like there are quite a few edge cases here and it's a bit tricky to find them via Storybook. Could we add a couple of unit tests? (Simple ones like the ones inside describe('character count') that we have in text-field.test.tsx?)

@scottlovegrove scottlovegrove merged commit abb4520 into main Mar 12, 2025
6 checks passed
@scottlovegrove scottlovegrove deleted the scottl/text-field-bordered branch March 12, 2025 15:37
@engfragui
Copy link
Contributor

engfragui commented Mar 12, 2025

variant: bordered + some endSlot passed in -> I would expect the endSlot to show up regardless of the value of endSlotPosition (even if it's undefined), right? 🤔 (I mean, it should just take the default value for endSlotPosition)

Storybook issue fixed in #902

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