Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Feature: Input Adornment #25

Merged
merged 9 commits into from
Jun 30, 2020
Merged

Feature: Input Adornment #25

merged 9 commits into from
Jun 30, 2020

Conversation

nicosampler
Copy link
Contributor

closes #21.

@nicosampler nicosampler added the enhancement New feature or request label Jun 25, 2020
@nicosampler nicosampler self-assigned this Jun 25, 2020
@ghost
Copy link

ghost commented Jun 25, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

<InputAdornment position="start">{startAdornment}</InputAdornment>
) : null,
endAdornment: endAdornment ? (
<InputAdornment position="start">{endAdornment}</InputAdornment>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be position="end"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no really, have you watch it on storybook? that set the position inside the Adornment, not at the start or end of the input.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, I tested it in the material-ui example. But behavior varies from what's in here.

wrong-possition

@fernandomg fernandomg self-requested a review June 26, 2020 22:18
Comment on lines 11 to 12
meta?: any;
input?: any; // added for compatibility with react-final-form
Copy link
Member

@mmv08 mmv08 Jun 27, 2020

Choose a reason for hiding this comment

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

Is it possible to make these typed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

<TextFieldMui {...props} />
))<Props>`
const CustomTextField = styled(
({ input, startAdornment, endAdornment, ...props }) => (
Copy link
Member

Choose a reason for hiding this comment

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

Are these typed?

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 did some changes, now it only receives ...props but it's a little tricky to type it. It Should be typed to TextFieldProps but TS is complaining about some overloads props and the message is not friendly at all.

I think it's having problems with InputProps args, but not I'm not sure, could you take a look, please?

Copy link
Member

@mmv08 mmv08 Jun 30, 2020

Choose a reason for hiding this comment

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

this is very hard to type, please don't use spread operators. Also, keep in mind that most of our components are just wrappers over Material UI components and they have their prop types exported (for example there is TextFieldProps) and we may take use of it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but in this particular case, we need to propagate the input props. How could we do it without using spread?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not saying anything about this particular case but in general

@ghost
Copy link

ghost commented Jun 29, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@ghost
Copy link

ghost commented Jun 29, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@ghost
Copy link

ghost commented Jun 29, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@ghost
Copy link

ghost commented Jun 30, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@ghost
Copy link

ghost commented Jun 30, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@ghost
Copy link

ghost commented Jun 30, 2020

Travis automatic deployment:
https://pr25--safereactcomponents.review.gnosisdev.com

@mmv08 mmv08 merged commit 8963a4f into development Jun 30, 2020
@mmv08 mmv08 deleted the issue-21-input-adornments branch June 30, 2020 13:43
@nicosampler nicosampler mentioned this pull request Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify input to support adornments
4 participants