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: delegatesFocus patch for ios causes rendering issues with item sliding in chrome #25273

Closed
4 of 7 tasks
deving1995 opened this issue May 10, 2022 · 7 comments · Fixed by #25822
Closed
4 of 7 tasks
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@deving1995
Copy link

Prerequisites

Ionic Framework Version

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

Current Behavior

When you click to drag an ion-item inside of an ion-item-sliding and you have an ion-input in the ion-item if you start the drag by hovering over the ion-label, then end the drag while hovering over the ion-input the slider abruptly jiggles to the left, slams shut, and when you drag it to open it again the ion-item-option is missing.

You can fix the ion-item-sliding by dragging it back to the left even though it is already shut.

I believe the issue is that the ion-item-option is somehow being pushed out of view.

Expected Behavior

I expect that when I am intending to drag an ion-item inside an ion-item-sliding that releasing the mouse while hovering over an ion-input will not cause the ion-item-sliding to close, or for the ion-item-option to disappear when re-opening.

Steps to Reproduce

  1. Click the ion-label of the ion-item
    • Do NOT let go of the mouse
  2. Drag the ion-item to the right until the cursor turns into a text-cursor
  3. Release the mouse
  4. Open the ion-item-sliding back up to see that the ion-item-option is now gone
<ion-item-sliding>
  <ion-item-options side="start">
    <ion-item-option>Test</ion-item-option>
  </ion-item-options>
  <ion-item>
    <ion-label>Test Slider</ion-label>
    <ion-input></ion-input>
  </ion-item>
</ion-item-sliding>

Before option disappears
image

After option disappears
image

And here's a gif of the issue in action
slider-issue

Code Reproduction URL

https://github.com/deving1995/ion-item-sliding-issue

Ionic Info

[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package'

   Require stack:
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module
'@capacitor/android/package'

   Require stack:
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js        
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\dgero\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

Ionic:

Ionic CLI : 6.18.1 (C:\Users\dgero\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.1.4
@angular-devkit/build-angular : 13.2.6
@angular-devkit/schematics : 13.2.6
@angular/cli : 13.2.6
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 3.5.1
@capacitor/android : not installed
@capacitor/core : 3.5.1
@capacitor/ios : not installed

Utility:

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

System:

NodeJS : v14.17.1 (C:\Program Files\nodejs\node.exe)
npm : 8.6.0
OS : Windows 10

Additional Information

The reason I believe the issue is that the ion-item-option is being pushed off screen is because you can actually get the ion-item-option to be partially out of view.

slider-issue2
.

@ionitron-bot ionitron-bot bot added the triage label May 10, 2022
@liamdebeasi liamdebeasi self-assigned this May 11, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This appears to be a Chrome specific bug. Focusing the input seems to cause the view to scroll/translate.

@deving1995
Copy link
Author

Thank you for the information, is there a workaround for this?

@liamdebeasi
Copy link
Contributor

This issue is caused by https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/item/item.tsx#L294. There is a bug on iOS 13 where delegatesFocus is not working correctly. As a result, we added a patch to try and fix the behavior.

Unfortunately, this had the unintended side effect of introducing the behavior reported here. Once we drop support for iOS 13, we should be able to remove this patch.


As for a workaround, you could try using a native <input> element instead of <ion-input> for now. The patch only activates if ion-item detects an ion-input or ion-textarea: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/item/item.tsx#L284

@liamdebeasi liamdebeasi changed the title bug: ion-item-sliding with ion-input causes ion-item-option to disappear bug: delegatesFocus patch for ios causes rendering issues with item sliding in chrome May 18, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels May 18, 2022
@ionitron-bot ionitron-bot bot removed the triage label May 18, 2022
@liamdebeasi liamdebeasi removed their assignment May 18, 2022
@liamdebeasi
Copy link
Contributor

Hi there,

We are proposing some changes to form components that seek to resolve this issue. We would love your feedback on these proposed changes! You can read more about the changes and leave comments here: #25661

@deving1995
Copy link
Author

Thank you!

@liamdebeasi
Copy link
Contributor

Hey there,

I merged a fix in via #25822 that resolves this issue. The relevant code was originally there to work around an iOS 13 bug. We will be dropping iOS 13 support in Ionic 7, so we are targeting the fix for that release.

I am going to close this since the code has been merged, but let me know if you have any questions. Thanks for the report!

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 24, 2022

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 Sep 24, 2022
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.

2 participants