This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
fix(Flex.Item): shrink issue #1086
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is already merged, sorry for not being able to review before that. However, there are a few things I'd like to mention.
1. what about the global values as string?
I think we should allow users to pass these too (see: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink#Syntax)

2. what about the true boolean value?
From the new code it looks like
will have no effect; to me that's not expected user behavior since the type of
shrinkprop is stillboolean | numberThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me start with the second question first - yes, this is exactly the effect you've described. The logic is correct as
<Flex.Item shrink />is, essentially, equivalent to <Flex.Item />, given that flex items are shrinkable by default (we've done it to correspond to CSS specs).Speaking of the first question - we might want to introduce support for mentioned props later, but for now extra prop values from the scope of
Flexcomponent were omitted in order to achieve the following:Thus, might suggest to leave it as is for now and return to the question of introducing these prop values (or use another solution approaches) when there will be an appealing use case for that.