SShortSingh.
Back to feed

CSS 'appearance: base-select' lets developers style native dropdowns without rebuilding them

0
·39 views

Frontend developers have long resorted to building custom dropdown components from scratch whenever designs require icons or rich styling inside select menus, since native HTML select elements can only render plain text. These hand-built alternatives introduce complex bugs, such as popup clipping caused by ancestor elements with overflow: hidden, and require manual scroll and resize listeners to stay positioned correctly. A bigger hidden cost is accessibility: native select elements provide keyboard navigation, type-ahead, screen reader announcements, and focus management for free, while most custom dropdowns only partially replicate this behavior. A new CSS property, appearance: base-select, now allows developers to style native select elements directly, including placing real markup like flag icons inside option elements, without sacrificing any built-in browser behavior. The feature also promotes the dropdown popup to the browser's top layer, eliminating clipping issues entirely; it is currently available in Chromium-based browsers, with Firefox and Safari support still in progress.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

NexoPeek: VR molecular lab lets users explore protein structures like lenacapavir's HIV target

A VR molecular lab called NexoPeek, running on Meta Quest, is presented as a way to make structural biology more intuitive. It offers twelve narrated tours organized into six knowledge areas, from basic biotechnology to green bioprocesses. The tools integrate data from several structure databases and support multiple rendering styles and analysis features such as pocket prediction and structural alignment. The article uses lenacapavir's binding to HIV-1 capsid as an example, showing how users can identify its binding pocket and hydrogen bonds in VR. The author stresses that the tool is for education and research visualization only, not for medical advice or diagnosis.

0
ProgrammingDEV Community ·

Why [] == ![] Is True in JavaScript: The Type Conversion Rules Explained

A developer's late-night puzzle over the expression [] == ![] being true is broken down step by step. The article explains that ! turns an empty array into false, and that the loose == operator then converts types before comparing. Each conversion, from array to string to number, is traced to show the result follows fixed rules rather than randomness. The author contrasts this with the strict === operator, which skips conversion entirely, and shares a personal lesson about wasting time chasing a bug that did not exist. The piece closes by reassuring beginners that these quirks follow a learnable rulebook.

0
ProgrammingDEV Community ·

Claude corrects a wrong landmark in its memory using 'dreaming' review sessions

Anthropic's November 6 article on agent memory uses a Pokémon Red example to show how a mistaken note can persist into later sessions and keep causing failures. In the case described, Claude wrongly recorded a Pokémon Center's position relative to Mount Moon, which led it to repeat an error after a one-way ledge fall. Anthropic describes 'dreaming' as additional sessions that review transcripts and reorganize persistent context, and in this case the corrected note let the branch reach Cerulean City. The article defines agent memory as knowledge kept in readable context between sessions and explicitly excludes changes to model weights. The source reports these results from its own evaluation, and the authors' gameplay claims were not independently replicated.

0
ProgrammingDEV Community ·

GitHub Copilot expands to JetBrains Air and Xcode, adds agent oversight tools

GitHub has brought Copilot into JetBrains Air and Xcode's built-in coding assistant, the latter in public preview from Xcode 27.3 beta. The JetBrains integration adds multiple-session tracking for running tasks locally or in the cloud via Air Teams, under an existing Copilot subscription. Alongside these entry points, GitHub bundled supervision features, including Agent Merge staying enabled while required checks are pending and tools for reviewing pull requests and managing sessions. The announcement leaves unstated details such as resource limits, plan eligibility, general-availability timing, and whether session management carries over to Xcode. Commentary notes that tracking sessions is not the same as coordinating agents.