VoiceOver doesn't scroll elements out of view properly - html

HTML fixed footer with vertically scrolling content (standard stuff I hope, overflow:auto etc.).
When vertically scrolling through elements via right-swipe VoiceOver gesture as soon as VoiceOver focus hits the elements at the bottom of the visible view the VoiceOver focus moves through elements correctly but the scrollbar only scrolls half the element height hence the VoiceOver focus moves below the visible area.
EDIT Updated snippet, in previous one height of container was less that 50%, updated for clarity to show that the height doesn't matter.
Thanks in advance.
.scrollContainer {
position: absolute;
overflow: auto;
top: 0;
width: 100%;
bottom: 100px;
}
.rightData {
float: right;
padding-right: 10px;
}
.stepData {
padding: 0px;
list-style-type: none;
margin-top: 0;
margin-bottom: 0;
}
.stepData > li {
height: 42px;
border-top: 1px solid black;
padding: 12px 20px;
font-size: 1.25em;
}
#footer {
position: absolute;
height: 100px;
width: 100%;
bottom: 0;
background-color: cyan;
}
<div style="height:500px;">
<div id="container" class="scrollContainer">
<ul class="stepData" style="padding:0px;">
<li role="button" aria-label="date">06/01<span class="rightData" aria-label="steps">1001</span></li>
<li role="button" aria-label="date">06/02<span class="rightData" aria-label="steps">1002</span></li>
<li role="button">06/03<span class="rightData">1003</span></li>
<li role="button">06/04<span class="rightData">1003</span></li>
<li role="button">06/05<span class="rightData">1005</span></li>
<li role="button">06/06<span class="rightData">1006</span></li>
<li role="button">06/07<span class="rightData">1007</span></li>
<li role="button">06/08<span class="rightData">1008</span></li>
<li role="button">06/09<span class="rightData">1009</span></li>
<li role="button">06/10<span class="rightData">1010</span></li>
<li role="button">06/11<span class="rightData">1011</span></li>
<li role="button">06/12<span class="rightData">1012</span></li>
<li role="button">06/13<span class="rightData">1013</span></li>
<li role="button">06/14<span class="rightData">1014</span></li>
<li role="button">06/15<span class="rightData">1015</span></li>
<li role="button">06/16<span class="rightData">1016</span></li>
<li role="button">06/17<span class="rightData">1017</span></li>
<li role="button">06/18<span class="rightData">1018</span></li>
<li role="button">06/19<span class="rightData">1019</span></li>
<li role="button">06/20<span class="rightData">1020</span></li>
<li role="button">06/21<span class="rightData">1021</span></li>
<li role="button">06/22<span class="rightData">1022</span></li>
<li role="button">06/23<span class="rightData">1023</span></li>
<li role="button">06/24<span class="rightData">1023</span></li>
<li role="button">06/25<span class="rightData">1025</span></li>
<li role="button">06/26<span class="rightData">1026</span></li>
<li role="button">06/27<span class="rightData">1027</span></li>
<li role="button">06/28<span class="rightData">1028</span></li>
<li role="button">06/29<span class="rightData">1029</span></li>
<li role="button">06/30<span class="rightData">1030</span></li>
<li role="button">07/01<span class="rightData">1031</span></li>
<li role="button">07/02<span class="rightData">1032</span></li>
<li role="button">07/03<span class="rightData">1033</span></li>
<li role="button">07/04<span class="rightData">1034</span></li>
<li role="button">07/05<span class="rightData">1035</span></li>
<li role="button">07/06<span class="rightData">1036</span></li>
<li role="button">07/07<span class="rightData">1037</span></li>
<li role="button">07/08<span class="rightData">1038</span></li>
<li role="button">07/09<span class="rightData">1039</span></li>
</ul>
</div>
<div id="footer">
<p>
footer
</p>
</div>
</div>

Not sure whether this helps but you can try setting the VoiceOver focus manually. If you're lucky, this might also scroll to the correct position.
If that does not work, you could try to use Element.scrollIntoView() which should work in the latest versions of Safari Mobile. But I am not sure whether that also plays nicely with VoiceOver.

The trick to making pages scrollable in Voiceover is to keep main content areas in the normal document flow using position:relative, not absolute. (I think overflow: hidden and max-height: 100% on the body element causes problems too, but I need to do more research.) The nav can use fixed positioning and slide in next to the rest of the content. One limitation is that a menu that also overflows the page height probably won’t scroll in Voiceover, as it will suffer from the original positioning bug.

Related

Chrome does not display background-color for a single child of an absolute positioned element with z-index and overflow scrolling

I have created the following test page to demonstrate the issue:
<html>
<head>
<style>
.panel {
position: absolute;
width: 326px;
max-height: 200px;
overflow: scroll;
z-index: 1000;
}
.item-container {
width: 100%;
list-style: none;
outline: 0;
padding: 0;
border: 0 none;
box-sizing: border-box;
cursor: pointer;
}
.item {
width: 100%;
}
.item.highlighted {
color: #fff;
background-color: #103e61;
}
</style>
</head>
<body>
<div class="panel">
<ul class="item-container">
<li class="item">Test1</li>
<li class="item">Test2</li>
<li class="item">Test3</li>
<li class="item">Test4</li>
<li class="item">Test5</li>
<li class="item">Test6</li>
<li class="item">Test7</li>
<li class="item">Test8</li>
<li class="item">Test9</li>
<li class="item">Test10</li>
<li class="item highlighted">Test11</li>
<li class="item">Test12</li>
<li class="item">Test13</li>
<li class="item">Test14</li>
<li class="item">Test15</li>
</ul>
</div>
</body>
</html>
Fiddle: https://jsfiddle.net/jfvtc1ek/
When opened with Chrome 70.0.3538.77, the "Test11" list element is shown in white when scrolled into view because Chrome does not render the background-color for some reason. It has something to do with the absolute positioning of the parent in combination with the z-index.
The same fiddle works in Firefox so I am not sure if this is a bug in Chrome?
You are right - probably a bug.
For Chrome:
it is working without position
it is working without z-index
it is working without overflow

How to make scrollbar scroll-able in mobile view chrome

I've been searching for StackOverflow about my problem, but I didn't find the answer, my problem is, I have navbar menu on top of my website which if you open from mobile browser (chrome, UC browser, etc) its show the scroll bar and the menu can be scrolled if you touch the menu text (black circle) not the scroll bar (blue circle), my scrollbar can't be drag to scroll the menu, but it can be clicked to drag the menu, here is the picture of the menu
and my css is here
.classsname{
height: 300px;
overflow-y: scroll;
position:relative;
z-index: 0;
-webkit-overflow-scrolling:touch;
-webkit-transform:translateZ(0);}
what did I do wrong?
EDIT: my full css with header nav, and header nav
on my php
#media (max-width: 991px)
{
.mean-nav .header-nav{
height: 300px;
overflow-y: scroll;
position:relative;
z-index: 0;
-webkit-overflow-scrolling:touch;
-webkit-transform:translateZ(0);
}
}
and i called this css below with this
<ul id="menu-main-menu" class="header-nav clearfix">
<li class="menu-item <?= $isHome ? 'current-menu-item' : '' ?>"><a title="Home" href="<?= Url::home();?>">Home</a>
</li>
<li class="menu-item menu-item-has-children <?php
$a = Url::current();
if((Url::current() == Url::to(['site/about'])) or (strpos($a, 'event')))
echo 'current-menu-item';
?>"><a title="About">About</a>
<ul class="sub-menu">
<li class="menu-item"><a title="Vision and Mission" href="<?= Url::to(['site/about']) ?>">Vision and Mission</a></li>
<li class="menu-item"><a title="Event" href="<?= Url::to(['event/index', 'page'=>'1']) ?>">Event</a></li>
</ul>
</li>
.....
</ul>
and on my css
a.meanmenu-reveal{
overflow-y: scroll;
z-index: 1;
top:-50px !important;
}
.mean-container .mean-bar .mean-nav ul li a.mean-expand{
font-size: 24px;
line-height: 18px !important;
}
nav.main-menu{margin-top:0;}

CSS Menu does not appear in correct place in IE and Firefox

The following is a screen capture of the issue that i'm faced with. The drop down menu is supposed to appear under the second menu item in the top menu.
The HTML is,
<nav class="nav">
<ul>
<li class="menu-item">Hi Alexander!</li>
<li class="menu-item"><a>My Account</a>
<div class="my-sub-menu">
<ul class="sub-list">
<li class="list-item"><a>History</a></li>
<li class="list-item"><a>Personal Details</a></li>
<li class="list-item"><a>Preferences</a></li>
<li class="list-item"><a>Bonuses</a></li>
<li class="list-item"><a>Wishlist</a></li>
<li class="list-item"><a>Newsletter</a></li>
<li class="list-item"><a>Invite Friends</a></li>
<li class="list-item"><a>FAQ</a></li>
<li class="list-item"><a>Sign out</a></li>
</ul>
</div>
</li>
<li class="menu-item"><a>Contact Us</a></li>
<li class="menu-item"><a>Chat</a></li>
<li class="menu-item"><a>Chat</a></li>
</ul>
</nav>
The CSS is as follows,
.nav {
margin-top: 2px;
position: relative;
float: right;
}
.nav > ul {
padding: 0;
margin: 0;
}
.menu-item{
list-style: none;
float: left;
}
.menu-item .my-sub-menu {
visibility: hidden;
position: absolute;
padding: 0;
margin: 0;
}
.menu-item:hover .my-sub-menu {
visibility: visible;
}
.list-item {
list-style: none;
}
I need the sub menu to appear under the second item in the top menu. This is only in firefox and IE but chrome renders it perfectly. I cant figure out what the issue is. Is there at least e fix that i could use for these two browsers? or another alternative to get around this issue.
Tahnk you in advance.
If you add position:relative to .menu-item it will make the absolute positioning work from the list item itself. The only draw back is if you are using a percentage based width on your drop down it will take the width of the parent li as 100% so a pixel width may have to be specified.
try doing
.sub-list{
padding:0px !important;
}
and if by second menu u want it to come under contact us
then change the position of the div
<div class="my-sub-menu">
<ul class="sub-list">
<li class="list-item"><a>History</a></li>
<li class="list-item"><a>Personal Details</a></li>
<li class="list-item"><a>Preferences</a></li>
<li class="list-item"><a>Bonuses</a></li>
<li class="list-item"><a>Wishlist</a></li>
<li class="list-item"><a>Newsletter</a></li>
<li class="list-item"><a>Invite Friends</a></li>
<li class="list-item"><a>FAQ</a></li>
<li class="list-item"><a>Sign out</a></li>
</ul>
</div>
into the next li element ie cntact us
kind of a fiddle
fiddle ex

How do I make a list clickable?

I'm currently working on a pure CSS color palette that needs to be a link. I've created this palette by using an unordered list, which I then wrapped in a <a> tag. I have a suspicion that this is not very semantic though. What would be the correct way to achieve this?
HTML
<div class="color-palette">
Modern Feminine
<a href="#">
<ul class="color-chips group">
<li class="grey">#999999</li>
<li class="slate">#666666</li>
<li class="lilac">#99878D</li>
<li class="blush">#7E4A5C</li>
<li class="plum">#372129</li>
</ul><!--.color-chips group-->
</a>
</div><!--.color-palette-->
CSS
.color-palette {
width: 280px;
margin: 0 auto;
padding: 0;
}
ul.color-chips {
margin: 0 auto;
padding: 0;
}
ul.color-chips li {
float: left;
margin: 0;
}
ul.color-chips li {
float: left;
width: 55px;
height: 55px;
text-indent: -9999px;
}
You can't put a list inside an anchor.
You need to make each of the individual items in the list a seperate link.
<ul class="color-chips group">
<li class="grey">#999999</li>
<li class="slate">#666666</li>
<li class="lilac">#99878D</li>
<li class="blush">#7E4A5C</li>
<li class="plum">#372129</li>
</ul><!--.color-chips group-->
If you don't need links because you're not actually linking to anything (i.e. you're performing on-the-page operations) simply remove the anchors all together. You don't need them when attaching your Javascript onclick events.
<ul class="color-chips group">
<li class="grey">#999999</li>
<li class="slate">#666666</li>
<li class="lilac">#99878D</li>
<li class="blush">#7E4A5C</li>
<li class="plum">#372129</li>
</ul>
What would you like to do after your click? Do you use javascript event when click is fired?
Since you're already handling clicks with JS, I assume the anchor is purely cosmetic. In that case you can use CSS:
.color-chips:hover {
cursor:pointer;
}

Display div on hover of different element

I'm trying to build a css drop down menu.
I have a div #category_list which is hidden and I want to display it once user hover over #category_drop list element. I tried
#category_drop:hover #category_list {visibility: visible;}
But this doesn't work. Can you please suggest any solution?
My full HTML
<div id="headbar-wrap">
<p id="back-top"><span></span></p>
<div id="head-bar">
<h1>website</h1>
<ul class="main-menu">
<li><a class="st_nav_menu" href="index.php">Home</a></li>
<li id="category_drop"><a class="st_nav_menu" href="#">Categories</a></li>
<li><a class="st_nav_menu" href="top.php">Top</a></li>
<li><a class="st_nav_menu" href="anti-top.php">Anti Top</a></li>
<li class="st_add_button">Add Story</li>
</ul>
<ul class="main-2-menu">
<li><a><span style="color: red; font-weight: bold; font-size: 16px; line-height: 44px; padding: 0 10px 0 10px;">Website is under construction.</span></a></li>
</ul>
<!-- this is a hidden drop down menu -->
<div id="category_list" style="height: 400px; width: 500px; background: #000; position: absolute; z-index: 999; top: 45px; visibility: hidden;"></div>
</div>
</div>
js Fiddle of a current situation http://jsfiddle.net/nzC65/2/
Please note that :hover doesn't work for non-anchor (a tag) on older browsers.
Secondly in your code, category_list is not a child of category_drop and hence your CSS will not actually match any elements.
Check this fiddle for a working implementation: http://jsfiddle.net/YT8YR/