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

bug: item-sliding, options don't display correctly in RTL mode on Firefox or Safari #26103

Closed
4 of 7 tasks
averyjohnston opened this issue Oct 11, 2022 · 7 comments · Fixed by #27203
Closed
4 of 7 tasks
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@averyjohnston
Copy link
Contributor

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

In core, a basic ion-item-sliding will not show its options properly when opened in Firefox or Safari in RTL mode. Interestingly, using the expandable prop causes the options to display somewhat when dragging far enough, but the text is positioned incorrectly.

Screencast from Firefox: https://user-images.githubusercontent.com/90629384/195179136-fda916dd-14ad-4b30-a5f4-3e801ac9f2c9.mp4

Expected Behavior

Screencast from Chrome: https://user-images.githubusercontent.com/90629384/195179307-1a31d302-7764-46c4-89e9-406097630444.mp4

Steps to Reproduce

Host core locally and open http://localhost:3333/src/components/item-sliding/test/basic?rtl=true in Firefox or Safari, then drag any item open.

Code Reproduction URL

http://localhost:3333/src/components/item-sliding/test/basic?rtl=true

Ionic Info

[WARN] You are not in an Ionic project directory. Project context may be missing.

Ionic:

   Ionic CLI : 6.18.1

Utility:

   cordova-res : not installed globally
   native-run  : 1.4.1

System:

   NodeJS : v16.13.0
   npm    : 8.1.0
   OS     : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Oct 11, 2022
@averyjohnston averyjohnston added package: core @ionic/core package type: bug a confirmed bug report labels Oct 11, 2022
@DwieDima
Copy link
Contributor

I was also able to reproduce this on LTR.

@averyjohnston
Copy link
Contributor Author

@DwieDima Do you have a Github repo I could look at? Checking in core again, I'm still only able to reproduce in RTL.

@DwieDima
Copy link
Contributor

@amandaejohnston we have this issue in our project, which i cannot share, but i'll try to setup a reproduction repo asap!

@DwieDima
Copy link
Contributor

DwieDima commented Nov 18, 2022

@amandaejohnston is was able to reproduce this behavior, and found another issue, too:

Bug where options won't show properly:

  • click the button "toggle sliding options"
  • slide to left
  • result: option on left slides to left, option on right slides to right
  • reason: custom width for ion-item-option (see example.component.css)

Bug where slides won't lock into position, instead close immediately:

  • click the button "toggle sliding options"
  • slide to left.
  • result: options will immediately close on release, instead lock into position.
  • reason: dynamically change ion-item-options using *ngIf.

https://stackblitz.com/edit/angular-bo8fxh?file=src/app/example.component.html

Bildschirmaufnahme.2022-11-18.um.10.40.09.mov

EDIT

Issue "Bug where options won't show properly" can be fixed using parts:

ion-item-option::part(native) {
   width: 80px;
}

Issue "Bug where slides won't lock into position, instead close immediately" can be fixed using single ion-item-options and instead using *ngIf on each ion-item-option or group it using ng-content.

nevertheless, the question would be whether this behavior is intended in this way.

thetaPC added a commit that referenced this issue May 9, 2023
Issue URL: resolves #26103, resolves #25285

---------

<!-- Please refer to our contributing documentation for any questions on
submitting a pull request, or let us know here if you need any help:
https://ionicframework.com/docs/building/contributing -->

<!-- Some docs updates need to be made in the `ionic-docs` repo, in a
separate PR. See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation
for details. -->

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Options in `item-sliding` will not display when using RTL with Firefox
and Safari.

<!-- Issues are required for both bug fixes and features. -->


## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

Issue was coming from `:host-context`. Firefox would keep [removing the
entire](https://www.w3.org/TR/selectors-3/#grouping) compiled style when
using this unsupported style. This would led to the RTL styles to not
being applied to the component.

- Split the CSS group from `add-root-selector()`
- Added comments to make it easier to navigate through
`add-root-selector()`
- Added `:dir()`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Co-authored-by: brandyscarney <brandyscarney@users.noreply.github.com>

- Updating `add-root-selector()` would also fix another
[issue](#25285)
unintentionally

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
@thetaPC
Copy link
Contributor

thetaPC commented May 9, 2023

The fix has been applied through PR #27203.

@thetaPC
Copy link
Contributor

thetaPC commented May 11, 2023

The fix has been released in v7.0.6.

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 10, 2023

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants