Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

[terra-search-field] Removed the terra-form-input and replaced it with a native input #3078

Merged
merged 9 commits into from
Jul 22, 2020

Conversation

pranav300
Copy link
Contributor

@pranav300 pranav300 commented Jul 15, 2020

Summary

This PR removes the use of terra-form-input from the search-field and replaces it with native input.
All the styles necessary for the input are taken directly from terra-form-input.

This is done to support placeholder in search-field after PR #3075 has been merged, which removes placeholder from the form-input and form-textarea.

Part of #2992

Deployment Link

https://terra-core-search-field-asffbr.herokuapp.com/components/terra-search-field/search-field/search-field

Testing

Additional Details

Thank you for contributing to Terra.
@cerner/terra

@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 17, 2020 04:57 Inactive
@emilyrohrbough
Copy link
Contributor

emilyrohrbough commented Jul 17, 2020

@pranav300 I'm confused, why do we need to replace terra-form-input with native input to fix the placeholder issue? Don't we need to filter out and remove the placeholder prop from being passed down to the terra-form-input?

Also, is this PR ready for review? Looking at this issue, there are UX TO DOs for terra-seach-field: #2992 (comment)

@pranav300
Copy link
Contributor Author

pranav300 commented Jul 17, 2020

@pranav300 I'm confused, why do we need to replace terra-form-input with native input to fix the placeholder issue? Don't we need to filter out and remove the placeholder prop from being passed down to the terra-form-input?

@emilyrohrbough
In terra-search-field, we do want to display placeholder and with the changes done in this PR #3075 it won't be possible with the terra-form-input.

This PR is not ready for review, I had raised it so that we can validate the approach.

@emilyrohrbough
Copy link
Contributor

This PR is not ready for review, I had raised it so that we can validate the approach.

This PR is not ready for review, can we move this to draft mode? and/or add a no not merge label on this PR. There was nothing in the summary to indicate this wan't ready for review.

Since this isn't ready, who is suppose to be validating this? Could that person have looked at the branch diff?

@pranav300 pranav300 marked this pull request as draft July 18, 2020 05:52
[dir=rtl] & {
box-shadow: var(--terra-search-field-input-focus-rtl-box-shadow);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should reduce these styles/variables as much as possible and apply only the ones necessary for theming the search field appropriately. Are all terra-form-input variables required to theme the search field?

Copy link
Contributor Author

@pranav300 pranav300 Jul 21, 2020

Choose a reason for hiding this comment

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

Are all terra-form-input variables required to theme the search field?

I had imported only the ones that were used by search-field when it imported form-input.
But still, I have gone through the CSS and removed some variables which I think were unnecessary here 468041b.

width: 100%;

&::placeholder {
color: var(--terra-search-field-input-placeholder-color, rgba(25, 32, 35, 0.53));
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is the same placeholder color that was used in form-input. Wouldn't this continue to have the insufficient color contrast with the background that we originally had in form-input?

Copy link
Contributor Author

@pranav300 pranav300 Jul 21, 2020

Choose a reason for hiding this comment

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

Updated here 7c7364d.

@pranav300 pranav300 changed the title [terra-search-field] Change terra-form-input to native input [terra-search-field] Removed the terra-form-input and replaced it with a native input Jul 21, 2020
@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 21, 2020 08:01 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 21, 2020 09:32 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 21, 2020 20:20 Inactive
@pranav300 pranav300 marked this pull request as ready for review July 21, 2020 20:26
@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 21, 2020 20:26 Inactive
@pranav300 pranav300 requested a review from emilyrohrbough July 21, 2020 20:27
@mjhenkes mjhenkes temporarily deployed to terra-core-search-field-asffbr July 21, 2020 21:17 Inactive
aria-disabled={isDisabled}
onKeyDown={this.handleKeyDown}
onInput={this.handleInput}
refCallback={this.setInputRef}
ref={this.setInputRef}
{...additionalInputAttributes}
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously, form-input will automatically add aria-required if required was passed to inputAttributes. Since this is no longer leveraging form-input, it would lose this logic. Should this be added here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I and @neilpfeiffer discussed this and decided that it is unneeded to make search-field a required field.

aria-disabled={isDisabled}
onKeyDown={this.handleKeyDown}
onInput={this.handleInput}
refCallback={this.setInputRef}
ref={this.setInputRef}
{...additionalInputAttributes}
Copy link
Contributor

Choose a reason for hiding this comment

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

It maybe not be part of this scope, but in general we spread pass-through attributes before our implementation specific ones so the behaviors cannot be overridden. So I'd like to see this moved.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @dkasper-was-taken - logged this new issue here to move the spread to first in the list: #3086

@neilpfeiffer
Copy link
Member

neilpfeiffer commented Jul 22, 2020

Tested: PR #3078
Part of Issue #2992 along with #3075

Reviewed:

  • Follows pattern considerations documented in Cerner Design Standards: Search: Global Search
  • Follows UX defined design implementation for Global Search
  • Follows defined theme designs: terra-default-theme, orion-fusion-theme, clinical-lowlight-theme


Fix with Followup Issues:


Related Updates (also will be updating usage of placeholders):
terra-core: issue #3083
terra-clinical: issue #680
terra-framework: issue #1193



Verified by @neilpfeiffer, ready to merge, merge before #3075,

Pass
UX Review

@neilpfeiffer neilpfeiffer added the ⭐ UX Reviewed UX Reviewed and approved. label Jul 22, 2020
@ryanthemanuel ryanthemanuel merged commit 0b9f37a into main Jul 22, 2020
@ryanthemanuel ryanthemanuel deleted the search-field-input branch July 22, 2020 22:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants