Skip to content

Properly center non-PrimeIcons inside a InputText Component #419

Answered by FlipWarthog
Fluxstone asked this question in PrimeVue
Discussion options

You must be logged in to vote

If you can set up a stackblitz showing the icon position issue I can probably come up with a better answer, but the style that's positioning the icon is:

.p-input-icon-left > i,
.p-input-icon-left > svg,
.p-input-icon-right > i,
.p-input-icon-right > svg {
    position: absolute;
    top: 50%;
    margin-top: -.5rem;
}

This looks to be assuming the icon is 1rem x 1rem so if your new icons are slightly different, you'll need to adjust that style in you application to account for the difference.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Fluxstone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants