Add align and sidePadding attributes#172
Open
mateuspiresl wants to merge 2 commits intoShawnLin013:masterfrom
Open
Add align and sidePadding attributes#172mateuspiresl wants to merge 2 commits intoShawnLin013:masterfrom
mateuspiresl wants to merge 2 commits intoShawnLin013:masterfrom
Conversation
Author
|
Since there is a bug in v2.4.10, I moved the changes to v2.4.9. |
|
Hey @ShawnLin013 could you merge this change? It'd be useful! |
|
I was also trying to figure out this problem! Merging would be appreciated! |
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.
Hi! I did a few changes in the project to accomplish some layout characteristics that I couldn't do using only the options currently available in the component. Since it may be something useful to somebody else, I'm creating this PR to contribute.
The layout had the elements of the picker aligned to the left but the text of the elements still centered accordingly to their width. As in the following image:
As you can see, the element of value 1 is aligned with the center of the one of value 100.
To accomplish this, I created two new optional attributes:
np_alignandnp_sidePadding. Both work only when the orientation is vertical. Thenp_alignattribute accepts three different values:left,center, andright. As suggested by itself, thealignattribute makes the component align its elements to the center (current and default behavior,) to the left, or to the right of the container. Thenp_sidePadding(default: 0) is applied only when thealignis not set tocenterbecause it would not be useful in this case. When defined,np_sidePaddingadds a space between the side of the alignment in the container and the element.Please, let me know if it's not interesting for this library or if there is any change that must be done before merging.