iPhone Issue scroll issue on pop-up - ios

Facing an issue in iPhone, creating a chatting web application. Having chat window on pop-up fixed position. when click on text input to send message, iPhone keyboard open it and shift the header part of chat section to top
Need to fix
Header and text-area should always be visible same as in whats-app
Set header-part to fixed position and same text-area on fixed, even keyboard is open or not
Prevent this shifting of header on top means prevent the iPhone scroll
Note: It is working fine in Android phone. Only issue with iPhone browsers, may be due to iPhone scroll.

Here is a simple conceptual example :
<article class="pop-up">
<h3>Title</h3>
<div class="content"> <p>Some scrollable content ...</p> </div>
<div> Some CTA buttons that should be visible for the user </div>
</section>
CSS:
.pop-up {
position: fixed;
// some other styles to display it as a popup
}
.content {
position: relative;
max-height: 100px; // set any max height that fits your design
overflow-y: scroll;
}

Related

Problem when the keyboard appear or dissapear in ionic with ios, only in ios in android works good

I have my ion footer with position:fixed and bottom:0, my ion footer is inside ion content.
My problem is that when the keyboard comes up on input, the element with the fixed position and bottom 0 stays down when it should go up with the keyboard, and it's weird because this only happens sometimes and not other times. And when my element is pushed up with the keyboard and the keyboard disappears, the element stays on top where I push it with the keyboard.
I think that when the keyboard appears the application does not realize that the height changes.
This problem only happens on ios, on android it works normal.
I leave you how is my code.
<ion-content [scrollEvents]="true">
<!-- Header -->
<app-header
title="RegĂ­strate"
iconLeft="icon-close"
backDirection="login">
</app-header>
<!-- Form -->
<form
class="w-100 container-main"
[formGroup]="form"
(ngSubmit)="onSubmit()"
>
//content
</form> <!-- End Form -->
<!-- Footer -->
<ion-footer class="ion-no-border footer-ionic">
<ion-toolbar class="ion-no-padding">
<div class="text-center">
<ion-button expand="block" color="primary" shape="round" [disabled]="form.invalid" (click)="onSubmit()"
type="submit" style="margin: 0px;">Siguiente</ion-button>
</div>
</ion-toolbar>
</ion-footer>
</ion-content>
And the css of my footer:
ion-footer{
position: fixed;
bottom: 0;
z-index: 1000;
}
Photos in the emulator, the problem not is the emulator i test the app in and phone with ios and have the same problem:
Initial frame
Footer element stay up with the keyboard, is this ok
the problemn is the footer stay up when keyboard dissapear
I need my footer stays fixed in the bottom position when the keyboard appears I push my footer up

ngx-chips tag-input-dropdown does not show autosuggest in iPhone

I have implemented ngx-chips for an email CC field. It works perfectly in my Android phone using Chrome. But, in iPhone, the autosuggestion does not show up.
<div class="required form-group col-md-12 col-sm-12 col-xs-12" >
<label class="control-label" for="email.emailCc">CC:</label>
<tag-input [(ngModel)]="emailList" [onlyFromAutocomplete]="true" theme='bootstrap'>
<tag-input-dropdown [autocompleteObservable]="items" [showDropdownIfEmpty]="true" [dynamicUpdate]="false">
</tag-input-dropdown>
</tag-input>
</div>
In Iphone
In Android
Please help.
Added following line in global.scss for IOS to show dropdown content,
div.ng2-dropdown-menu.ng2-dropdown-menu---width--4.ng2-dropdown-menu--open {
display: block !important; // to display the drop down content
max-height: 40vh !important; // for scrolling of suggestion list
}
But still it is not good as it is on android. Scrolling the screen scrolls the list with it.
We were facing the same issue. The problem is not data showing up, rather the placement of the dropdown due to the Zoom of textbox in IPhone. With css hacks we were able to place the drop down in proper position.

Why is my position:sticky not working on iOS?

I'm in the process of coding a sticky notification bar seated at the bottom of a mobile screen. I want the bar to be stuck at the bottom of the users screen until the user has reached the scroll position of where the bar is actually positioned in the code (which is just before the footer of the page).
I have pretty much copied the "doctor" example from this page: https://alligator.io/css/position-sticky/
My problem is: On my page, the bar works fine when using Android Devices or when simulating a mobile device by adjusting the Browser width on my Desktop Computer. However, on iOS, the bar is not sticky, i.e. it just sits at its position and doesn't stick to the bottom of the screen until reached. This applies to both Safari and Google Chrome.
The weird thing is: On the previously mentioned alligator.io page, it works just fine on my iOS device.
I suspect this is some kind of Webkit problem having to do with the code surrounding the bar, but I cannot isolate it. I have tried debugging by adjusting my code as far as possible to the example from alligator.io, but I cannot get it to work. I have also tried looking for any overflow:auto in parent elements - without success. I have been trying to fix this for several hours and am sick and tired of the problem and could use another pair of eyes to help me find what I'm overlooking.
#jobalarm_mobile {
display: table;
font-size: 18px;
width: 100%;
height: 40px;
background: #ff8400;
color: white;
font-weight: 400;
text-align: center;
position: -webkit-sticky;
position: sticky;
bottom: -50px;
align-self: flex-end;
}
<a href="#" class="jobAlertToggle">
<div id="jobalarm_mobile">
<i class="fa fa-bell"></i>
<span>Jobalarm aktivieren</span>
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
</a>
You can visit the live page I am working on at (hidden on request of the customer, please contact me privately).
Simply start any (suggested) search and the bar will pop up (or not, if you are using iOS...)
Thanks in advance for your help.
I feel like an idiot for answering my own question, but I figured out what is causing the problem.
I hope this will help developers facing the same problem because I could not find anywhere defining this behavior.
As you can see, in my code, there is a wrapper (specifically a link) around the element, on which I use my position:sticky:
<a href="#" class="jobAlertToggle">
<div id="jobalarm_mobile">
<i class="fa fa-bell"></i>
<span>Jobalarm aktivieren</span>
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
</a>
For some reason, this is not a problem for Chrome or Firefox on Desktop as well as Android, as they seem to ignore this container, probably because it doesn't define any positioning behavior. This is why it works on other devices. However, iOS does not ignore the container and therefor positions the div relative to its parent container, which is the link. After removing the link for test purposes, it worked on all devices.
This is the real answer
position: -webkit-sticky;
position: -moz-sticky;
position: -o-sticky;
position: -ms-sticky;
position: sticky;
and works!!!
Some of the tips in my answer here may help, notably adding display: block to your container may do the trick.
For me nothing worked except jQuery/javascript in this way: give the element you need to be sticky position:absolute and left: 0, then use javascript to calculate offset of the window to the left, and add that offset to the left property of your element:
#stickyElement {
position: absolute;
left: 0;
}
function scrolling(){
$('.someElementScrollingLeft').on('scroll', function() {
let offset = $(this).scrollLeft();
/* For me it only didn't work on phones, so checking screen size */
if($( window ).width() <= 768)
{
let stickyElement = $('#stickyElement');
stickyElement.css("left", offset);
}
});
}
In my case in full screen menu it was overflow-y: auto. I eliminated this issue by adding: overscroll-behavior: contain.
I visited a website and may be I found solution for you.
Try this it may can help you:
#jobalarm_mobile {
display: none !important;
}
and then place your notification <a> tag at the end (after <footer> tag)
//write this css
.jobAlertToggle{
display: none;
}
#media (max-width: 767px)
.jobAlertToggle{
display: block;
width: 100%;
position:sticky;
position:-webkit-sticky;
bottom:-50px;
}
#jobalarm_mobile {
display: table;
font-size: 18px;
width: 100%;
height: 40px;
background: #ff8400;
color: white;
font-weight: 400;
text-align: center;
-webkit-align-self: flex-end;
align-self: flex-end;
}
For my problem it was:
I had { contain: paint; } in ancestor (container above inside-container).
Changed it to { overflow: clip; }
Sticky would not work if contain: paint was present regardless of having overflow: clip.
This was tested on Iphone 15.4.1. Other tested devices didn't break with contain: paint (tested on chrome, ipad, android)
I had so many problems with this issue as well. The sticky position wouldn't work on my phone - not in Safari or Chrome.
I tried placing the element that I wanted sticky in the top of the surrounding wrapper - it worked! Apparently the sticky position can't really work if there is something above it inside the same parent-wrapper. You don't have to change your order or design, you can just create a wrapper that's around the content, with the sticky element in the top.
<div class="container">
<p>Some text above the sticky element</p>
<div class="inside-container">
<div class="sticky-element">
<p>This is sticky</p>
</div>
<p>Some more text, that scrolls past the sticky element.</p>
</div>
</div>
I think the Problem is, that Safari (the Browser of iOS) does not support position: sticky properly. See this Article (https://caniuse.com/#feat=css-sticky). Read the Known Issues Section to find aut more. Maybe, you have to deactivate it for iOS and show a note on your Page, that its not working properly.
I hope, I could help you.
Use for ios position: -webkit-sticky and for other case position: sticky

Skrollr height issue / content getting cutt off on iPad and touch devices

I've been struggling with this one for a while. I'm using skrollr on a new site, and it is working great on the desktop. However, the content is getting cut off on ipad and android touch devices after turning the device from either landscape to portrait or vice versa. It is very similar to the problem described here : Skrollr cutoff on iPad, but the solution they recommended there is not fixing the problem for me.
This can sort of be fixed by adding padding to the bottom of the skrollr-body div, but the amount needed changes between portrait and landscape. The page seems to need a refresh when that is changed, so CSS and media queries aren't cutting it for me at the time.
Any ideas? Really digging Skrollr otherwise, but this is driving me crazy.
Here is the link for viewing :
http://rweststaging.com/stackoverflow/test.php
Here is the basic code :
// Top fixed section
<div id="animation"
data-0p="position:fixed; top:0%;"
data-100p="position:fixed; top:0%;"
data-120p="position:fixed; top:0%;"
data-210p="position:fixed; top:-130%; opacity:1; display:block;"
data-220p="opacity:0; display:none;"
>
</div>
//lower content section
<div id="skrollr-body"
style="position: absolute; top: 220%; width: 100%;"
data-top="" data-bottom=""
>
//content sections go here
</div> // end skrollr body
//skroller init
skroll = skrollr.init({
// mobileCheck:function(){return false;},
forceHeight:false,
smoothScrolling: true,
smoothScrollingDuration: 600
});
I've experienced issues putting by not having the #skrollr-body div independent (as this inherits a new function when detecting mobile).
So try wrapping your #skrollr-body div around your div with sections -
// Top fixed section ...
<div id="skrollr-body" style=""> // no styles
<div class="nonfixed" style="position:absolute; top:220%; width:100%;">
// all non-fixed elements
</div>
</div>

Strange background image "effect" in jQuery Mobile

I'm noticing an odd effect in jQuery Mobile when viewing a page's background image on a low resolution screen (or resizing your browser's window to simulate a small screen). When navigating to a page with a background image, the image appears near the bottom of the screen for a split second, before "jumping" up to the center of the screen (it should appear in the center of the screen right from the start).
I set up a fiddle to demonstrate what I'm referring to. To get the full effect, first resize the fiddle "Result" window (bottom right of the screen) to where it's approximately the size of the div with the red background. Then click on the "Image page" button.
http://jsfiddle.net/FgVz8/3/
What causes the background image to have this "jerky" behavior? And more importantly, any ideas how I can fix it?
It wouldn't be a big deal if it was just a single image, but I'm building an image gallery with back/forward buttons, and every single image (each on a separate jQM "page") that is navigated to exhibits this strange effect, so it makes for a rather "unsmooth" user experience... especially when viewing multiple images one after another.
Any help is greatly appreciated!
Edit: it looks like Stack Overflow won't let me link out to JSFiddle unless I also post my code here, so here's my code...
HTML body...
<div id="home_page" data-role="page">
<div id="content" data-role="content">
Image page
</div>
</div>
<div id="image_page" data-role="page">
<p>Test 123...</p>
</div>
CSS...
#content {
background: red;
width: 200px;
height: 250px;
}
#image_page {
background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Logo_Google_2013_Official.svg/2000px-Logo_Google_2013_Official.svg.png);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}

Resources