Isolation Mode - Clearing and Creating a new Row - singularitygs

Okay - I've read John Albin Wilkins http://palantir.net/blog/responsive-design-s-dirty-little-secret - and I now understand the motivation for the 'isolation' mode (and how it's implemented).
I then read Sam's initial rebuttal of isolation mode, although he's updated his post to say that he's coming 'round to the idea (or that at least he understands the motivation for it) - http://snugug.com/musings/on-responsive-designs-dirty-little-secret
If I've understood all of this correctly, one enhancement that Singularity offers over Zen grids, is that it allows you to mix output styles (for example you could switch to float output in the middle of a layout using the #import layout mixin).
However, in isolation mode - I'm still not clear on how you 'clear a row' - as John Albin Wilkins mentions in his post...
While floated items with this technique can no longer see each other’s right edge, they can still see their bottom edges when clearing. And it means you can start a new row of grid items by simply clearing the previous grid items and this new row will be positioned below all the previous content.
Let's say I have a section and inside that I have 6 articles - and I want all of the articles to occupy 1 column of a two column grid in the section.
grid-span(1,1)
grid-span(1,2)
/* next row */
grid-span(1,1)
grid-span(1,2)
/* next row */
grid-span(1,1)
grid-span(1,2)
Maybe I'm obsessing a little with row clearing, although I confess that with this occurring 'naturally' in a float output, and with Sam latching on to it in his post, and with neither post describing exactly 'how' you clear the row in isolation mode without using a clearfix container, my curiosity is piqued.

To clear a row, use clear: both on the first item of the row.
Note that Singularity isolation span mixin applies clear: right, so you have to apply your clear: both after the span mixin:
.foo
+grid-span(1, 1)
.bar
+grid-span(1, 2)
.baz
+grid-span(1, 1)
clear: both
.quux
+grid-span(1, 2)
For more background info on clearing, read this answer: Layout using Singularity

Related

Responsive UI - modify reading order in screen readers?

I have a responsive layout that must be accessible for screen readers. The issue is around the order of buttons on desktop vs mobile.
On desktop the button order is
Cancel - Remind Me Later - Learn More
...and the screen reader reads left to right. However on mobile the button order is vertically stacked and is ordered as the reverse of the desktop:
Learn more
Remind me later
Cancel
The problem is the screen reader still reads as if user was in desktop mode - the visual order no longer matches.
Is there a way for the screen reader to change the reading order depending on the viewport?
In general, screen reading software ignores CSS (*). The order of your DOM is the order the screen reader will read it. Even if you used tabindex, that will only control the order of tabbing through the interface. If you use CSS to reposition elements, whether through flexbox or grid or float, the screen reading software will ignore that.
A screen reader user can simply walk the DOM (**) by using the up/down arrow keys. (** The user is not really walking the DOM but rather the accessibility tree, but it's similar to the DOM. Not every element in the DOM will be on the accessibility tree, but it's a similar analogy).
So, the only way to "control" the order that a screen reader hears the elements is by modifying the order of the elements in your DOM.
(*) (If you have a :before or :after pseudo-element with a content property, that property will be read by a screen reader as noted in step 2F of the "Accessible Name and Description Computation")
This is a common issue and there are a few solutions you can do. Without knowing much about your codebase, here are a few suggestions for you:
Not knowing how complex your markup is, you could provide a version of the form elements that are only visible on small screens. That way you can explicitly control the accessibility tree structure.
Another option, you can use CSS (flexbox or grid) to reposition the buttons based your media query for small screens.
While this would work, I would not advice using "tabindex="1", "2", "3" "..." to control tab order seeing as how your UI is not rendering in the correct order anyway.
Hope this helps. Good luck with your project.
Is there a way for the screen reader to change the reading order depending on the viewport?
One solution is to have two sets of the same menu and use your media queries to use one or the other
<div class="desktop">Cancel - Remind Me Later - Learn More</div>
<div class="mobile">
Learn more
Remind me later
Cancel
</div>
CSS:
.mobile {display:none}
#media screen and (max-width: 600px) {
.desktop {display:none}
.mobile {display:block}
}
This way, you will be free to let the DOM order match the visual order.

can't scroll to the end of data kendo-ui-grid

I want to use kendo-ui-grid server paging with virtual scrolling and encountered a problem I don't know how to solve
It's shown in here:
http://dojo.telerik.com/uyEje
Try scrolling to row number 2M.
Anybody has any idea?
According to the Kendo UI documentation ...
"Virtual scrolling relies on a fake scrollbar. Its size is not determined by the browser, but is calculated based on the average row height of the data that is already loaded. As a result, variable row heights may cause unexpected behavior, such as inability to scroll to the last rows on the last page. To ensure that all table rows have the same heights, use either of the options: (1) Disable text wrapping. (2) Set an explicit row height that is large enough (as demonstrated in the following example)."

IcCube - Treefilter without scrollbar and with only limited number of elements

We try to use the treefilter in IcCube to show categories with subcategories. Now we discovered two problems, we don't know, how to fix:
We have 15 categories on level 1, but only the first 11 of them show. There is some space underneath, so it doesn't seem to be cut due to rendering:
We are not able to activate a vertical scrollbar, so when we unfold the tree, there are parts we cannot see anymore. The hotizontal scrollbar is there, but once the tree is too big (image 2) it can't be used anymore as well.
Did we do something wrong and there are options we didn't see, or are our problems due to some bugs in this widget?
Point 1)
Try to increase Max Member Count property on the Query Wizard tab of the widget (this number is for all the members to be managed, not only level 1 items)
Point 2)
Try adding {"cssStyle":"overflow:auto"} in the Content CSS property of the Box tab of the widget.

Overlapping scroll

I have a couple of sections, each containing a few sub-sections. Something like this:
Section A
Subsection 1
Subsection 2
Subsection 3
Section B
Subsection 1
Subsection 2
Subsection 3
...
When the user scrolls the bottom of the last sub-section into the viewport that sub-section should stop scrolling.
Then while the user scrolls further the next section should scroll in above it and overlap it.
I'd like the overlapping section to scroll like normal, with the exception that it goes above the previous one.
I hope this awesome gif can explain it a little better than words can...
I've been looking at solving this with jQuery and checking how far the document has been scrolled and trying to apply position fixed at the right time and position. But haven't been able to get the effect I'm after. I'll have to admit that my jQuery skills isn't the best and that I'm stuck.
Does anyone have a pointer in the right direction for me on how to solve this?
I hate leaving unanswered questions on StackOverflow, that's why I'm answering a question 3 years after. If you want to run a function when the user sees something when he scrolls, there is a jQuery plugin called NoobScroll (just google it or go on this link) Then, you should checkout the scrollOn() function, or the scrollProgress() function on the documentation (wiki on GitHub) to trigger an animation, and I hope you'll solve your problem

Win32 List-View Control SubItem padding for custom-drawn SubItems?

When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right
padding in my custom paint method that is applied by the control itself for non-custom-drawn items.
Is there a way to programmatically retrieve this padding value? Is it
related to the width of a particular character (" " or "w" or something?) or
is it a fixed value (6px on left and 3px on right or something) or...?
EDIT: To clarify, I want to add the same padding to my NM_CUSTOMDRAWn SubItems that the control adds to items that it draws, and the metric that I'm looking for, for example, is the white space between the beginning of the 2nd column and the word "Siamese" in the following screenshot (Note: screenshot from MSDN added to help explain my question):
(source: microsoft.com)
Note that the word "Siamese" is aligned with the header item ("Breed"). I would like to be able to guarantee the same alignment for custom-drawn items.
use ListView Header message HDM_GETBITMAPMARGIN
see link text
ListView_GetSubItemRect (LVM_GETSUBITEMTECT)
http://msdn.microsoft.com/en-us/library/ms930172.aspx
Despite what the documentation says I suspect LVIR_LABEL returns just the returns the bounding rectangle of the item text, as per ListView_GetItemRect.
(This just kept niggling me as I though I had actually seen an answer somewhere when playing with NM_CUSTOMDRAW).
Edit After Comment 2:
I imagine you have seen NMLVCUSTOMDRAW which if you are willing to use Version 6.0. has rcText. I wouldn't since I use Win2K.
Given what you have found I would go back to the suggestion of using
ListView_GetItemRect to get LVIR_LABEL and compare that with LVIR_BOUNDS and use the difference.
the way for doing this is retrieving the format of the corresponding column with
ListView_GetColumn()
then check the retrieved myLVCOLUMN.mask
LVCOLUMN myLVCOLUMN;
myLVCOLUMN.mask=LVCF_FMT;
ListView_GetColumn(hwnd,nCol,&myLVCOLUMN);
then when we draw the corresponding label belonging to that column
if(myLVCOLUMN.fmt & LVCFMT_CENTER)
DrawText(x,x,x,x, DT_CENTER | DT_WORD_ELLIPSIS );
else if (myLVCOLUMN.fmt & LVCFMT_RIGHT)
DrawText(x,x,x,x, DT_RIGHT | DT_WORD_ELLIPSIS );
else
DrawText(x,x,x,x, DT_LEFT | DT_WORD_ELLIPSIS );
I would assume that GetSystemMetrics() is that you need to look at. I think that SM_CXEDGE and SM_CYEDGE are probably the values you want, but don't quote me on that. ;-)
Can only guess without seeing your output.
A few suggestions: If you are using the DrawTextEx function, have you have experimented with DT_INTERNAL et al?
Are you accidentally putting in a blank image/icon.
Does it look ok in classic screen mode? If so I would look at XP Theme functions to see if some thing is going on.
Late edit after first comment:
I wonder if the size of rectangle matches the space required for the LVN_ENDLABELEDIT edit box around the text so the text doesn't move (or for a focus rectangle)?
I guess you could compare the result of LVM_GETITEMRECT with LVIR_LABEL on the first column and use the difference as your left border.

Resources