
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
makeup-listbox-button
Advanced tools
A JavaScript class that represents an ARIA listbox button. No CSS provided.
The following markup structure and classnames are required. Any SVG icons can be used.
<span class="listbox-button">
<button class="expand-btn" style="min-width: 150px" aria-expanded="false" aria-haspopup="listbox">
<span class="expand-btn__cell">
<span class="expand-btn__text">Option 1</span>
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
<use href="icon.svg#icon-dropdown"></use>
</svg>
</span>
</button>
<div class="listbox-button__listbox">
<div class="listbox-button__options" role="listbox" tabindex="0">
<div class="listbox-button__option" role="option">
<span class="listbox-button__value">Option 1</span>
<svg class="icon icon--tick-small" focusable="false" height="8" width="8">
<use href="icon.svg#icon-tick-small"></use>
</svg>
</div>
<div class="listbox-button__option" role="option">
<span class="listbox-button__value">Option 2</span>
<svg class="icon icon--tick-small" focusable="false" height="8" width="8">
<use href="icon.svg#icon-tick-small"></use>
</svg>
</div>
<div class="listbox-button__option" role="option">
<span class="listbox-button__value">Option 3</span>
<svg class="icon icon--tick-small" focusable="false" height="8" width="8">
<use href="icon.svg#icon-tick-small"></use>
</svg>
</div>
</div>
</div>
</span>
No CSS is provided. However, the class is fully compatible with eBay Skin.
import ListboxButton from "makeup-listbox-button";
document.querySelectorAll(".listbox-button").forEach(function (el, i) {
const widget = new ListboxButton(el, config);
el.addEventListener("makeup-listbox-button-change", function (e) {
console.log(e.type, e.detail);
});
});
The constructor takes a configuration object as its second parameter.
todo
Fired when the listbox selection is changed.
fromValue
: the old valuetoValue
: the new valueFAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.