lec

Correction: Preparation of electrospray ALG/PDA–PVP nanocomposites and their application in cancer therapy

Soft Matter, 2020, 16,4074-4074
DOI: 10.1039/D0SM90064H, Correction
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Yangjie Xu, Jiulong Zhao, Zhilun Zhang, Jing Zhang, Mingxian Huang, Shige Wang, Pei Xie
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Assessing the Extent of Structural and Dynamic Modulation of Membrane Lipids due to Pore Forming Toxins: Insights from Molecular Dynamics Simulations

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00086H, Paper
Vadhana Varadarajan, Rajat Desikan, Ganapathy Ayappa
Infections in many virulent bacterial strains are triggered by the release of pore forming toxins (PFTs), which form oligomeric transmembrane pore complexes on the target plasma membrane. The spatial extent...
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Liposomal adhesion via electrostatic interactions and osmotic deflation increase membrane tension and lipid diffusion coefficient

Soft Matter, 2020, Advance Article
DOI: 10.1039/D0SM00416B, Paper
Atsushi Oda, Chiho Watanabe, Natsumi Aoki, Miho Yanagisawa
Liposome–liposome adhesion by electrostatic interactions and osmotic contraction increase membrane tension and the lipid diffusion coefficient compared to isolated liposomes.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Investigating the Role of Carbon Nanotubes (CNTs) in Piezoelectric Performance of PVDF/KNN based Flexible Electrospun Nanogenerator

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00438C, Paper
Satyaranjan Bairagi, Wazed Ali
In the present study, the effect of varying concentrations of carbon nanotube (CNT) on the piezoelectric performance of poly (vinylidene fluoride) (PVDF)/potassium sodium niobate (KNN) based electrospun nanocomposite has been...
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Classical and Non-Classical Melatonin Receptor Agonist-Directed Micellization of Bipyridinium-Based Supramolecular Amphiphiles in Water

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00424C, Paper
Zhimin Sun, Lihui Xi, Kai Zheng, Zhao Zhang, Kim Baldridge, Mark Anthony Olson
The addition of molecular recognition units into structures of amphiphiles is a means by which soft matter capable of undergoing template-directed micellization can be obtained. These supramolecular amphiphiles can bind...
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Impact of Chiral Supramolecular Nanostructure on the Mechanical and Electrical Performances of Triphenylene-based discotic physical gels

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00152J, Paper
Hongli Zhang, Junjie Cheng, Qiang Zhou, Qijin Zhang, Gang Zou
Discotic π-conjugated supramolecular assemblies, especially with chiral supramolecular nanostructures, have been attracting growing research interests due to their significant optoelectronic properties and the possibilities of their applications in the new...
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Lipid-core/polymer-shell hybrid nanoparticles: synthesis and characterization by fluorescence labeling and electrophoresis

Soft Matter, 2020, 16,4173-4181
DOI: 10.1039/D0SM00077A, Paper
Sophie Bou, Xinyue Wang, Nicolas Anton, Redouane Bouchaala, Andrey S. Klymchenko, Mayeul Collot
New hybrid nanoparticles have been obtained by simple nanoprecipitation using fluorescent labeling of both the oily core (BODIPY) and the polymeric shell (rhodamine) thus allowing the use of electrophoresis to assess their formation and stability.
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Effect of network homogeneity on mechanical, thermal and electrochemical properties of solid polymer electrolytes prepared by homogeneous 4-arm poly(ethylene glycols)

Soft Matter, 2020, 16,4290-4298
DOI: 10.1039/D0SM00289E, Paper
Monami Tosa, Kei Hashimoto, Hisashi Kokubo, Kazuhide Ueno, Masayoshi Watanabe
The effect of network inhomogeneity in solid polymer electrolytes on its electrolyte properties was investigated by employing a model polymer network composed of a homogeneous 4-arm poly(ethylene glycol) (tetra-PEG) network and Li salt.
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Systematic approach for wettability prediction using molecular dynamics simulations

Soft Matter, 2020, 16,4299-4310
DOI: 10.1039/D0SM00197J, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Ahmed Jarray, Herman Wijshoff, Jurriaan A. Luiken, Wouter K. den Otter
An efficient approach for fast screening of liquids in terms of their wetting properties.
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Vesicle adhesion in the electrostatic strong-coupling regime studied by time-resolved small-angle X-ray scattering

Soft Matter, 2020, 16,4142-4154
DOI: 10.1039/D0SM00259C, Paper
Open Access
Karlo Komorowski, Jannis Schaeper, Michael Sztucki, Lewis Sharpnack, Gerrit Brehm, Sarah Köster, Tim Salditt
We have used time-resolved small-angle X-ray scattering (SAXS) to study the adhesion of lipid vesicles in the electrostatic strong-coupling regime induced by divalent ions.
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Saddle-curvature instability of lipid bilayer induced by amphipathicpeptides: A molecular model

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00499E, Paper
Rachel Downing, Guilherme Volpe Bossa, Sylvio May
Amphipathic peptides that partition into lipid bilayers affect the curvature elastic properties oftheir host. Some of these peptides are able to shift the Gaussian modulus to positive values, thustriggering an...
The content of this RSS Feed (c) The Royal Society of Chemistry




lec

Does your 2020 talent plan reflect automation and AI trends?


Automation and Artificial Intelligence (AI) are radically changing the way modern networks are being designed, operated and resourced.
More RSS Feed for Cisco: newsroom.cisco.com/rss-feeds ...




lec

[ASAP] Low-Threshold Lasing up to 360 K in All-Dielectric Subwavelength-Nanowire Nanocavities

ACS Photonics
DOI: 10.1021/acsphotonics.0c00166




lec

[ASAP] Modulation of the Visible Absorption and Reflection Profiles of ITO Nanocrystal Thin Films by Plasmon Excitation

ACS Photonics
DOI: 10.1021/acsphotonics.9b01825




lec

[ASAP] Size, Ligand, and Defect-Dependent Electron–Phonon Coupling in Chalcogenide and Perovskite Nanocrystals and Its Impact on Luminescence Line Widths

ACS Photonics
DOI: 10.1021/acsphotonics.0c00034




lec

[ASAP] Exciton-Polaritons with Magnetic and Electric Character in All-Dielectric Metasurfaces

ACS Photonics
DOI: 10.1021/acsphotonics.0c00063




lec

[ASAP] Gain-Assisted Optomechanical Position Locking of Metal/Dielectric Nanoshells in Optical Potentials

ACS Photonics
DOI: 10.1021/acsphotonics.0c00213




lec

[ASAP] Probing the Radiative Electromagnetic Local Density of States in Nanostructures with a Scanning Tunneling Microscope

ACS Photonics
DOI: 10.1021/acsphotonics.0c00264




lec

Making a Better Custom Select Element

Julie Grundy kicks off this, our fifteenth year, by diving headlong into the snowy issue of customising form inputs. Nothing makes a more special gift at Christmas that something you’ve designed and customised yourself. But can it be done while staying accessible to every user?


In my work as an accessibility consultant, there are some frequent problems I find on people’s websites. One that’s come up a lot recently is that people are making custom select inputs for their forms. I can tell that people are trying to make them accessible, because they’ve added ARIA attributes or visually-hidden instructions for screen reader users. Sometimes they use a plugin which claims to be accessible. And this is great, I love that folks want to do the right thing! But so far I’ve never come across a custom select input which actually meets all of the WCAG AA criteria.

Often I recommend to people that they use the native HTML select element instead. Yes, they’re super ugly, but as Scott Jehl shows us in his article Styling a Select Like It’s 2019 they are a lot easier to style than they used to be. They come with a lot of accessibility for free – they’re recognised and announced clearly by all screen reader software, they work reliably and predictably with keyboards and touch, and they look good in high contrast themes.

But sometimes, I can’t recommend the select input as a replacement. We want a way for someone to choose an item from a list of options, but it’s more complicated than just that. We want autocomplete options. We want to put images in there, not just text. The optgroup element is ugly, hard to style, and not announced by screen readers. The focus styles are low contrast. I had high hopes for the datalist element, but although it works well with screen readers, it’s no good for people with low vision who zoom or use high contrast themes.

Figure 1: a datalist zoomed in by 300%

Select inputs are limited in a lot of ways. They’re frustrating to work with when you have something which looks almost like what you want, but is too restricted to be useful. We know we can do better, so we make our own.

Let’s work out how to do that while keeping all the accessibility features of the original.

Semantic HTML

We’ll start with a solid, semantic HTML base. A select input is essentially a text input which restricts the possible answers, so let’s make a standard input.

<label for="custom-select">User Type</label>
<input type="text" id="custom-select">

Then we need to show everyone who can see that there are options available, so let’s add an image with an arrow, like the native element.

<label for="custom-select">User Type</label>
<input type="text" id="custom-select">
<img src="arrow-down.svg" alt="">

For this input, we’re going to use ARIA attributes to represent the information in the icon, so we’ll give it an empty alt attribute so screen readers don’t announce its filename.

Finally, we want a list of options. An unordered list element is a sensible choice here. It also lets screen reader software understand that these bits of text are related to each other as part of a group.

<ul class="custom-select-options">
  <li>User</li>
  <li>Author</li>
  <li>Editor</li>
  <li>Manager</li>
  <li>Administrator</li>
</ul>

You can dynamically add or remove options from this list whenever you need to. And, unlike our <option> element inside a <select>, we can add whatever we like inside the list item. So if you need images to distinguish between lots of very similar-named objects, or to add supplementary details, you can go right ahead. I’m going to add some extra text to mine, to help explain the differences between the choices.

This is a good base to begin with. But it looks nothing like a select input! We want to make sure our sighted users get something they’re familiar with and know how to use already.

Styling with CSS

I’ll add some basic styles similar to what’s in Scott Jehl’s article above.

We also need to make sure that people who customise their colours in high contrast modes can still tell what they’re looking at. After checking it in the default Windows high contrast theme, I’ve decided to add a left-hand border to the focus and hover styles, to make sure it’s clear which item is about to be chosen.

This would be a good time to add any dark-mode styles if that’s your jam. People who get migraines from bright screens will thank you!

JavaScript for behaviour

Of course, our custom select doesn’t actually do anything yet. We have a few tasks for it: to toggle the options list open and closed when we click the input, to filter the options when people type in the input, and for selecting an option to add it to the input and close the list. I’m going to tackle toggling first because it’s the easiest.

Toggling

Sometimes folks use opacity or height to hide content on screen, but that’s like using Harry Potter’s invisibility cloak. No-one can see what’s under there, but Harry doesn’t cease to exist and you can still poke him with a wand. In our case, screen reader and keyboard users can still reach an invisible list.

Instead of making the content see-through or smaller, I’m going to use display: none to hide the list. display: none removes the content from the accessibility tree, so it can’t be accessed by any user, not just people who can see. I always have a pair of utility classes for hiding things, as follows:

.hidden-all {
  display: none;
}

.hidden-visually {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    border: 0;
} 

So now I can just toggle the CSS class .hidden-all on my list whenever I like.

Browsing the options

Opening up our list works well for our mouse and touch-screen users. Our styles give a nice big tap target for touch, and mouse users can click wherever they like.

We need to make sure our keyboard users are taken care of though. Some of our sighted users will be relying on the keyboard if they have mobility or dexterity issues. Usually our screen reader users are in Browse mode, which lets them click the arrow keys to navigate through content. However, custom selects are usually inside form elements. which pushes screen reader software to Forms Mode. In Forms mode, the screen reader software can only reach focusable items when the user clicks the Tab key, unless we provide an alternative. Our list items are not focusable by default, so let’s work on that alternative.

To do this, I’m adding a tabindex of -1 to each list item. This way I can send focus to them with JavaScript, but they won’t be part of the normal keyboard focus path of the page.

csOptions.forEach(function(option) {
    option.setAttribute('tabindex, '-1')
}) 

Now I can move the focus using the Up and Down arrow keys, as well as with a mouse or tapping the screen. The activeElement property of the document is a way of finding where the keyboard focus is at the moment. I can use that to loop through the elements in the list and move the focus point forward or back, depending on which key is pressed.

function doKeyAction(whichKey) {
  const focusPoint = document.activeElement
  switch(whichKey) {
    case: 'ArrowDown':
      toggleList('Open')
      moveFocus(focusPoint, 'forward')
      break
    case: 'ArrowUp':
      toggleList('Open')
      moveFocus(focusPoint, 'back')
      break
  }
}

Selecting

The Enter key is traditional for activating an element, and we want to match the original select input.

We add another case to the keypress detector…

case 'Enter':
  makeChoice(focusPoint)
  toggleList('Shut')
  setState('closed')
  break 

… then make a function which grabs the currently focused item and puts it in our text input. Then we can close the list and move focus up to the input as well.

function makeChoice(whichOption) {
    const optionText = whichOption.documentQuerySelector('strong')
    csInput.value = optionText
}

Filtering

Standard select inputs have keyboard shortcuts – typing a letter will send focus to the first item in the option which begins with that letter. If you type the letter again, focus will move to the next option beginning with that letter.

This is useful, but there’s no clue to tell users how many options might be in this category, so they have to experiment to find out. We can make an improvement for our users by filtering to just the set of options which matches that letter or sequence of letters. Then sighted users can see exactly how many options they’ve got, and continue filtering by typing more if they like. (Our screen reader users can’t see the remaining options while they’re typing, but don’t worry – we’ll have a solution for them in the next section).

I’m going to use the .filter method to make a new array which only has the items which match the text value of the input. There are different ways you could do this part – my goal was to avoid having to use regex, but you should choose whatever method works best for your content.

function doFilter() {
  const terms = csInput.value
  const aFilteredOptions = aOptions.filter(option => {
    if (option.innerText.toUpperCase().startsWith(terms.toUpperCase())) {
    return true
    }
  })
  // hide all options
  csOptions.forEach(option => option.style.display = "none")
  // re-show the options which match our terms
  aFilteredOptions.forEach(function(option) {
    option.style.display = ""
  })
} 

Nice! This is now looking and behaving really well. We’ve got one more problem though – for a screen reader user, this is a jumble of information. What’s being reported to the browser’s accessibility API is that there’s an input followed by some clickable text. Are they related? Who knows! What happens if we start typing, or click one of the clicky text things? It’s a mystery when you can’t see what’s happening. But we can fix that.

ARIA

ARIA attributes don’t provide much in the way of additional features. Adding an aria-expanded='true' attribute doesn’t actually make anything expand. What ARIA does is provide information about what’s happening to the accessibility API, which can then pass it on to any assistive technology which asks for it.

The WCAG requirements tell us that when we’re making custom elements, we need to make sure that as a whole, the widget tells us its name, its role, and its current value. Both Chrome and Firefox reveal the accessibility tree in their dev tools, so you can check how any of your widgets will be reported.

We already have a name for our input – it comes from the label we associated to the text input right at the start. We don’t need to name every other part of the field, as that makes it seem like more than one input is present. We also don’t need to add a value, because when we select an item from the list, it’s added to the text input and therefore is exposed to the API.

Figure 2: How Firefox reports our custom select to assistive technology.

But our screen readers are going to announce this custom select widget as a text entry field, with some images and a list nearby.

The ARIA Authoring Practices site has a pattern for comboboxes with listboxes attached. It tells you all the ARIA you need to make screen reader software give a useful description of our custom widget.

I’m going to add all this ARIA via JavaScript, instead of putting it in the HTML. If my JavaScript doesn’t work for any reason, the input can still be a plain text field, and we don’t want screen readers to announce it as anything fancier than that.

csSelector.setAttribute('role', 'combobox') 
csSelector.setAttribute('aria-haspopup', 'listbox')
csSelector.setAttribute('aria-owns', '#list') 
csInput.setAttribute('aria-autocomplete', 'both')
csInput.setAttribute('aria-controls', 'list')

The next thing to do is let blind users know if the list is opened or closed. For that task I’m going to add an aria-expanded attribute to the group, and update it from false to true whenever the list changes state in our toggling function.

The final touch is to add a secret status message to the widget. We can use it to update the number of options available after we’ve filtered them by typing into the input. When there are a lot of options to choose from, this helps people who can’t see the list reducing know if they’re on the right track or not.

To do that we first have to give the status message a home in our HTML.

<div id='custom-select-status' class='hidden-visually' aria-live='polite'></div>

I’m using our visually-hidden style so that only screen readers will find it. I’m using aria-live so that it will be announced as often as it updates, not just when a screen reader user navigates past it. Live regions need to be present at page load, but we won’t have anything to say about the custom select then so we can leave it empty for now.

Next we add one line to our filtering function, to find the length of our current list.

updateStatus(aFilteredOptions.length)

Then we send that to a function which will update our live region.

function updateStatus(howMany) {
    console.log('updating status')
    csStatus.textContent = howMany + " options available."
}

Conclusion

Let’s review what we’ve done to make an awesome custom select input:

  • Used semantic HTML so that it’s easily interpreted by assistive technology while expanding the types of content we can include in it
  • Added CSS styles which are robust enough to survive different visual environments while also fitting into our branding needs
  • Used JavaScript to provide the basic functionality that the native element has
  • Added more JavaScript to get useful functionality that the native element lacks
  • Carefully added ARIA attributes to make sure that the purpose and results of using the element are available to assistive technology and are updated as the user interacts with it.

You can check out my custom select pattern on GitHub – I’ll be making additions as I test it on more assistive technology, and I welcome suggestions for improvements.

The ARIA pattern linked above has a variety of examples and customisations. I hope stepping through this example shows you why each of the requirements exists, and how you can make them fit your own needs.

I think the volume of custom select inputs out there shows the ways in which the native select input is insufficient for modern websites. You’ll be pleased to know that Greg Whitworth and Simon Pieters are working on improving several input types! You can let them know what features you’d like selects to have. But until that work pays off, let’s make our custom selects as accessible and robust as they can possibly be.


About the author

Julie Grundy is an accessibility expert who works for Intopia, a digital accessibility consultancy. She has over 15 years experience as a front-end web developer in the health and education sectors. She believes in the democratic web and aims to unlock digital worlds for as many people as possible. In her spare time, she knits very slowly and chases very quickly after her two whippets.

More articles by Julie




lec

Cigarette taxes and smoking among sexual minority adults [electronic resource] / Christopher Carpenter, Dario Sansone

Cambridge, Mass. : National Bureau of Economic Research, 2020




lec

The effects of e-cigarette taxes on e-cigarette prices and tobacco product sales [electronic resource] : evidence from retail panel data / Chad D. Cotti, Charles J. Courtemanche, Johanna Catherine Maclean, Erik T. Nesson, Michael F. Pesko, Nathan Tefft

Cambridge, Mass. : National Bureau of Economic Research, 2020




lec

Effect of prescription opioids and prescription opioid control policies on infant health [electronic resource] / Engy Ziedan, Robert Kaestner

Cambridge, Mass. : National Bureau of Economic Research, 2020




lec

Cigarette taxes and teen marijuana use [electronic resource] / D. Mark Anderson, Kyutaro Matsuzawa, Joseph J. Sabia

Cambridge, Mass. : National Bureau of Economic Research, 2020




lec

Suburban Xanadu [electronic resource] : the Casino Resort on the Las Vegas Strip and Beyond

Hoboken : Taylor & Francis, 2003.




lec

Vicious games [electronic resource] : capitalism and gambling / Rebecca Cassidy.

London : Pluto Press, 2020.




lec

Drug courts [electronic resource] : a new approach to treatment and rehabilitation / James E. Lessenger, Glade F. Roper, editors

New York : Springer, [2007]




lec

The moccasin game [electronic resource] / produced by the National Film Board of Canada. --

Montreal : National Film Board of Canada, 1983.




lec

The evolving consequences of OxyContin reforumulation on drug overdoses [electronic resource] / David Powell, Rosalie Liccardo Pacula

Cambridge, Mass. : National Bureau of Economic Research, 2020




lec

MANHATTAN COM. ACCESS, ET AL. v. HALLECK, DEEDEE, ET AL.. Decided 06/17/2019




lec

Primary elections in the United States / Shigeo Hirano, Columbia University ; James M. Snyder, Jr., Harvard University

Dewey Library - JK2071.H57 2019




lec

Reflections on socialism in the Twenty-First Century: facing market liberalism, rising inequalities and the environmental imperative / Claes Brundenius, editor

Online Resource




lec

The politics of recall elections Yanina Welp, Laurence Whitehead, editors

Online Resource




lec

Why veterans run: military service in American presidential elections, 1789-2016 / Jeremy M. Teigen

Dewey Library - JK524.T36 2018




lec

Utah politics and government: American democracy among a unique electorate / Adam R. Brown

Dewey Library - JK8416.B76 2018




lec

Nationalism and the economy: explorations into a neglected relationship / edited by Stefan Berger and Thomas Fetzer

Dewey Library - JC311.N221234 2019




lec

Electronic warfare signal processing / James Genova

Barker Library - UG485.G46 2018




lec

Brazil: neoliberalism versus democracy / Alfredo Saad-Filho and Lecio Morais

Rotch Library - JL2431.S23 2018




lec

I am the people: reflections on popular sovereignty today / Partha Chatterjee

Dewey Library - JC423.C366 2020




lec

Pork barrel politics: how government spending determines elections in a polarized era / Andrew H. Sidman

Dewey Library - JK1976.S58 2019




lec

The national question and electoral politics in Quebec and Scotland / Éric Bélanger, Richard Nadeau, Ailsa Henderson, Eve Hepburn

Dewey Library - JC311.B45 2018




lec

Votes that count and voters who don't: how journalists sideline electoral participation (without even knowing it) / Sharon E. Jarvis and Soo-Hye Han

Dewey Library - JK1965.J37 2018




lec

Manish Tiwari: Congress not to bank on any personality in election

"UPA will fight the polls on the basis of the strength of its policies and programmes."




lec

MP stampede: 21 officials including Datia collector suspended as toll reaches 115

Election Commission stated that the stampede had become a law-and-order issue.




lec

Election Commission approves distribution of caps, stickers for electioneering

Distribution of T-shirts, shirts, trousers and saris with political party symbols have been prohibited.




lec

In election season, Muslim factions unite, meet Sonia Gandhi

Majlis-e-Mushawarat, takes up Muzaffarnagar riots, anti-communal violence Bill with Sonia.




lec

From domination to coloring [electronic resource] : Stephen Hedetniemi's graph theory and beyond / Gary Chartrand, Teresa W. Haynes, Michael A. Henning, Ping Zhang.

Cham, Switzerland : Springer, [2019]




lec

Special functions and computer science [electronic resource] / by Philip Feinsilver and René Schott

Dordrecht ; Boston : Kluwer Academic, c1993




lec

A field guide to algebra [electronic resource] / Antoine Chambert-Loir

New York : Springer, [2005]




lec

Extreme Value Theory [electronic resource] : An Introduction / by Laurens de Haan, Ana Ferreira

New York, NY : Springer New York, 2006




lec

Algáebre [electronic resource] Chapitre 10. Algáebre homologique / by N. Bourbaki

Berlin, Heidelberg : Springer Berlin Heidelberg, 2006