Skip to content
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

Add align and sidePadding attributes #172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mateuspiresl
Copy link

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:

picker

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_align and np_sidePadding. Both work only when the orientation is vertical. The np_align attribute accepts three different values: left, center, and right. As suggested by itself, the align attribute makes the component align its elements to the center (current and default behavior,) to the left, or to the right of the container. The np_sidePadding (default: 0) is applied only when the align is not set to center because it would not be useful in this case. When defined, np_sidePadding adds 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.

@mateuspiresl
Copy link
Author

Since there is a bug in v2.4.10, I moved the changes to v2.4.9.

@Damercy
Copy link

Damercy commented Aug 1, 2021

Hey @ShawnLin013 could you merge this change? It'd be useful!

@dbalatoni13
Copy link

I was also trying to figure out this problem! Merging would be appreciated!

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.

None yet

3 participants