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

Style issue when styling with custom height #2369

Open
MilosLbr opened this issue May 8, 2024 · 2 comments
Open

Style issue when styling with custom height #2369

MilosLbr opened this issue May 8, 2024 · 2 comments

Comments

@MilosLbr
Copy link

MilosLbr commented May 8, 2024

Describe the bug
Selected option looks a little misaligned when custom height of the dropdown is selected via css rules

Reproducbile example
https://stackblitz.com/~/github.com/nemanja010/ng-select-height-example

To Reproduce
I tried to reduce the height of ng-select-container by targeting it with css as seen in the stackblitz example.
When the selected height is small, e.g. less that 25px, and you select something from the dropdown, the selected option looks a bit misaligned and asymmetrical.

Screenshots
image

Desktop (please complete the following information):

  • OS: windows 10
  • Browser: Chrome Version 124.0.6367.119

Additional context
I am trying to support the design that has different sizes of the dropdown component for different views.

@abdallahmmu
Copy link

you can also try to restyle .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input, by make the top to 0px

I think when the input focused it added some class that made the select or the placeholder go top you just need to make it 0px

I hope this helps you let me try if not.

@MilosLbr
Copy link
Author

MilosLbr commented May 10, 2024

@abdallahmmu

you can also try to restyle .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input, by make the top to 0px

I think when the input focused it added some class that made the select or the placeholder go top you just need to make it 0px

I hope this helps you let me try if not.

Removing the top 5px kinda works for the small dropdown from the example, but it looks misaligned again when you want a bigger dropdown:

image

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

No branches or pull requests

2 participants