You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an issue with the Cube Effect in Swiper version 11.2.1 on iOS 14.x devices within a webview (jd app). The 3D carousel images appear larger compared to those in the Safari browser. By adding the overflow:hidden; style to the swiper container, the issue becomes more apparent.
Upon reading the source code and debugging, I found that the problem lies in determining the value of needPerspectiveFix based on the userAgent. In this scenario, the correct value is not being obtained, leading to an error in calculating the zFactor for the cube effect. This results in different behaviors between the webview and Safari browser.
Problematic userAgent in jd app webview: "jdapp;iphone;15.0.0;;;m/5.0;appbuild/15.0.0;jdsupportdarkmode/0;ef/1;ep/%7b%22ciphertype%22%3a5%2c%22cipher%22%3a%7b%22ud%22%3a%22ytc5cwczdzrwywo4cwdsyzgzdwc4cnhwztundqtrequ2enuycwo1cq%3d%3d%22%2c%22sv%22%3a%22cjgkcm%3d%3d%22%2c%22iad%22%3a%22%22%7d%2c%22ts%22%3a1737539181%2c%22hdid%22%3a%22jm9f1ywupwflvmipypok0tt5k9kw4arjeu3lflhxbqw%3d%22%2c%22version%22%3a%221.0.3%22%2c%22appname%22%3a%22com.qzibuy.mobile2%22%2c%22ridx%22%3a-1%7d;mozilla/5.0 (iphone; cpu iphone os 14_3 like mac os x) applewebkit/605.1.15 (khtml, like gecko) mobile/15e148;supportjdshwk/1;"
Safari browser userAgent: "mozilla/5.0 (iphone; cpu iphone os 14_3 like mac os x) applewebkit/605.1.15 (khtml, like gecko) version/14.0.2 mobile/15e148 safari/604.1"
Expected Behavior
In Safari browser display is OK:
The Cube Effect should display images at the same size as in the Safari browser on the same device.
Actual Behavior
In webview display is not OK:
On iOS 14.x devices, the Cube Effect images are enlarged, resulting in more cropping.
Swiper version
11.2.1
Platform/Target and Browser Versions
iOS version: 14.x;Webview environment: jd app webview opened via QR code scan
Check that this is really a bug
Reproduction link
https://codepen.io/txiejun/pen/azoRGdK
Bug description
I am experiencing an issue with the Cube Effect in Swiper version 11.2.1 on iOS 14.x devices within a webview (jd app). The 3D carousel images appear larger compared to those in the Safari browser. By adding the overflow:hidden; style to the swiper container, the issue becomes more apparent.
Upon reading the source code and debugging, I found that the problem lies in determining the value of needPerspectiveFix based on the userAgent. In this scenario, the correct value is not being obtained, leading to an error in calculating the zFactor for the cube effect. This results in different behaviors between the webview and Safari browser.
Problematic userAgent in jd app webview:
"jdapp;iphone;15.0.0;;;m/5.0;appbuild/15.0.0;jdsupportdarkmode/0;ef/1;ep/%7b%22ciphertype%22%3a5%2c%22cipher%22%3a%7b%22ud%22%3a%22ytc5cwczdzrwywo4cwdsyzgzdwc4cnhwztundqtrequ2enuycwo1cq%3d%3d%22%2c%22sv%22%3a%22cjgkcm%3d%3d%22%2c%22iad%22%3a%22%22%7d%2c%22ts%22%3a1737539181%2c%22hdid%22%3a%22jm9f1ywupwflvmipypok0tt5k9kw4arjeu3lflhxbqw%3d%22%2c%22version%22%3a%221.0.3%22%2c%22appname%22%3a%22com.qzibuy.mobile2%22%2c%22ridx%22%3a-1%7d;mozilla/5.0 (iphone; cpu iphone os 14_3 like mac os x) applewebkit/605.1.15 (khtml, like gecko) mobile/15e148;supportjdshwk/1;"
Safari browser userAgent:
"mozilla/5.0 (iphone; cpu iphone os 14_3 like mac os x) applewebkit/605.1.15 (khtml, like gecko) version/14.0.2 mobile/15e148 safari/604.1"
Expected Behavior
In Safari browser display is OK:
The Cube Effect should display images at the same size as in the Safari browser on the same device.
Actual Behavior
In webview display is not OK:
On iOS 14.x devices, the Cube Effect images are enlarged, resulting in more cropping.
Swiper version
11.2.1
Platform/Target and Browser Versions
iOS version: 14.x;Webview environment: jd app webview opened via QR code scan
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: