Combobox test 1 - Datalist JSON suggestion - Research and finding
Prototype of an select
box transformed into a customized combobox
with the listbox pattern.
View more different example bellow
- {{ autofillItem.textContent }}
Default persistent option
A dummy link for tab sequence testing
Source code
HTML
<label for="id_select">Please choose an option</label>
<select id="id_select" class="wb-combobox" name="selLoremIpsum">
<template>
<ul class="list-unstyled">
<li role="option" data-wb5-for="autofillItem in select.options" data-wb5-selectvalue="{{autofillItem.textContent.toUpperCase()}}">{{ autofillItem.textContent }}</li>
</ul>
<hr class="brdr-bttm mrgn-tp-sm mrgn-bttm-sm">
<p role="option" data-wb5-selectvalue="my default value">Default persistent option</p>
</template>
<option value="Lorem">Lorem</option>
<option value="ipsum">ipsum</option>
<option value="dolor">dolor</option>
<option value="sit">sit</option>
</select>
CSS
<style>
/* Overlay default style */
[role=listbox] {
min-width: 230px;
background: white;
border: 1px solid #ccc;
list-style: none;
margin: 0;
padding: 0;
position: absolute;
top: 1.7em;
z-index: 9999;
/* Note about z-index
Ideally it should be set to 1, but the
Javascript
wet-boew plugin - 2018-assets/1-datalist-combobox.js