Skip to content

Fixed the ChipsInput field trimmed bug #2183

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

Merged
merged 5 commits into from
Aug 15, 2022
Merged

Conversation

adids1221
Copy link
Contributor

Description

ChipsInput field get trimmed when inserting more than 1 line of chips.

Changelog

ChipsInput field get trimmed when inserting more than 1 line of chips.

@adids1221
Copy link
Contributor Author

Ethan please take a look at this PR, I removed the felxGrow prop from the Input component that fix the bug.
#1734

@@ -45,7 +44,7 @@ const Input = ({

const styles = StyleSheet.create({
input: {
flexGrow: 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I checked why we added this flexGrow.
We did it in this PR
#1734

But unfortunately, I can't reproduce the bug it was meant to fix.
We can merge the PR and worse case we can revert if the bug appear again.

Another option is to pass a style that overrides the flexGrow from the ChipsInput code.

What do you prefer to do?

@adids1221 adids1221 requested a review from ethanshar August 14, 2022 10:30
@@ -142,6 +142,7 @@ const ChipsInput = forwardRef((props: ChipsInputProps, refToForward: React.Ref<a
ref={fieldRef}
leadingAccessory={chipList}
blurOnSubmit={false}
style={{flexGrow: undefined}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't pass inline styles
It creates a new object ref every render which triggers subsequent re-renders for inner components that depends on this prop

@adids1221 adids1221 requested a review from ethanshar August 14, 2022 13:55
@ethanshar ethanshar merged commit b4f1bfa into master Aug 15, 2022
@adids1221 adids1221 deleted the fix/ChipsInput_field_trimmed branch August 24, 2022 07:34
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