Add prop pickedOrder for new selected initial order#126
Closed
xipasduarte wants to merge 3 commits into10up:developfrom
Closed
Add prop pickedOrder for new selected initial order#126xipasduarte wants to merge 3 commits into10up:developfrom
prop pickedOrder for new selected initial order#126xipasduarte wants to merge 3 commits into10up:developfrom
Conversation
When selecting a new item for the list, the only option was to have the item pushed to the top. This adds support for two other sorts: - `end` pushes the item to end of the `content` array - `function` if user defined a function they may control where to push the new item - `start` becomes the default value, keeping the current behavior
Member
|
Closing this as stale for now |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When selecting a new item for the list, the only option was to have the
item pushed to the top. This adds support for two other sorts:
endpushes the item to end of thecontentarrayfunctionif the user defines a function they may control where to pushthe new item
startbecomes the default value, keeping the current behaviorDescription of the Change
When selecting a new item for the list, depending on the value of
pickedOrdernew item is pushed on the array ofcontentaccording to its value.startbecomes the default value, keeping the current behaviorendpushes the item to end of thecontentarrayfunctionif user defined a function they may control where to pushthe new item
As mentioned, keeping the default value at
startavoids breaking the current behavior.Closes #125
Alternate Designs
I considered only using a boolean value alone with a prop like
pickedOrderEnd, only to negate the current behavior when needed, but the current approach seems more versatile. Also, adding the option for a function allows the user reach for control of how this is done in some specific cases (e.g. always pushing in alphabetical order).Possible Drawbacks
Given the default behavior is kept, I don't see any at the moment.
Verification Process
I've only done manual testing, but am hoping to open this for feedback, especially for the prop name (
propInitialOrder, maybe?).Will do some unit testing/e2e depending on how #124 is reviewed (they change the same components and it would be nice to reduce conflicts).
Checklist:
Changelog Entry
Credits
Props @xipasduarte