ion-input nested within ion-item doesn't respect --padding-end
See original GitHub issueBug Report
Ionic version: [x] 4.x
Current behavior: Creating a floating label ion-input and adding this style
ion-item {
--padding-start: 0px;
--padding-end: 0px;
}
or this one
ion-item {
--padding-start: 0px;
ion-input {
--padding-end: 0px;
}
}
will results in changing only the “start” side.
Expected behavior: Both padding should follow the padding variable setted
Steps to reproduce: Add a simple IonInput component:
<ion-item>
<ion-label position="fixed">Floating Label</ion-label>
<ion-input></ion-input>
</ion-item>
with the following CSS:
ion-item {
--padding-start: 0px;
--padding-end: 0px;
}
Other information: Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.2
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0
System:
NodeJS : v10.15.0
npm : 6.4.1
OS : Linux 4.18
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to remove the padding around ion-item? - Stack Overflow
If you want to remove inner paddding, use ion-item custom CSS properties: ion-item { --padding-end: 0px; --inner-padding-end: 0px; ...
Read more >ion-item - Ionic Framework
ion-item elements for iOS/Android contain text, icons, images, and other custom elements. They're placed in a list and can be input, deleted, edited, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue! Item is structured in the following way:
So when you are styling
--padding-start
and--padding-end
you are changing the padding on the host elemention-item
. I believe the padding you are seeing is coming from the default padding on the.item-inner
which allows us to pad the items in theend
slot without losing the bottom border that stretches all of the way to the right.What you’re looking for is the following:
See the CSS Custom properties for item here: https://ionicframework.com/docs/api/item#css-custom-properties
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.