A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
refactor(item-sliding): remove unused CSS from item options (#28367)
Issue number: Internal
---------
## What is the current behavior?
Item sliding has some unused CSS and no tests for safe area padding
based on the direction.
This CSS is not used:
https://github.com/ionic-team/ionic-framework/blob/feda7a0e963048d300eb17d4b9e1056f09088714/core/src/components/item-option/item-option.scss#L20-L30
The rendered markup for a sliding item looks like the following:
```html
<ion-item-sliding>
<ion-item-options side="start">
<ion-item-option>
Archive
</ion-item-option>
</ion-item-options>
<ion-item class="in-list">
<ion-label>
Sliding Item
</ion-label>
</ion-item>
</ion-item-sliding>
```
Since `ion-item-options` never gets the `in-list` class added to it, and
`ion-item` never contains options, the above CSS is never used.
## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
- Removed the CSS that is not used, the correct CSS for safe area
padding has already been added here:
https://github.com/ionic-team/ionic-framework/blob/feda7a0e963048d300eb17d4b9e1056f09088714/core/src/components/item-options/item-options.scss#L57-L67
- Added screenshot tests to verify the safe area padding is applied to
the proper side
## Does this introduce a breaking change?
- [ ] Yes
- [x] No
## Other information
I could add additional tests that make sure there is not padding added
when opening the opposite side on each direction but since this problem
was happening when changing from `ltr` to `rtl` I did not.
[FW-5174]:
https://ionic-cloud.atlassian.net/browse/FW-5174?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
---------
Co-authored-by: ionitron <hi@ionicframework.com> B
Brandy Carney committed
416bb736a13473851fb0150dac676cb094d49b8f
Parent: 0188289
Committed by GitHub <noreply@github.com>
on 10/18/2023, 4:01:31 PM