SShortSingh.
Back to feed

Browsers Now Have a Native Popover API, Replacing Custom Dropdown Hacks

0
·2 views

The browser-native Popover API, part of Baseline 2024, is now available in Chrome 114, Firefox 125, and Safari 17, offering a built-in solution for dropdown and overlay UI components. Developers have long relied on manual JavaScript, z-index stacking, and event listeners to handle open/close state, light dismiss, and keyboard navigation for dropdowns. The Popover API eliminates this boilerplate by linking a button to a popover element via a simple HTML attribute, with Escape-key dismissal and outside-click closing handled automatically by the browser. Popovers render in the browser's top layer, bypassing stacking context issues that cause menus to be clipped or hidden behind other elements. Two modes are available — auto for user-dismissible menus and manual for developer-controlled UI like toasts — with a small JavaScript API and CSS animation support rounding out the feature set.

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 ·

WhatsApp Turned Into Field Logistics ERP Using Apps Script and Google Sheets

The MageSheet team has published a guide detailing how to convert WhatsApp into a mobile ERP system for field logistics, eliminating the need for dedicated driver apps. The system uses a Google Apps Script webhook to receive driver messages, parse them via regex, and fall back to a low-cost LLM like GPT-4o-mini for unstructured input, updating a Google Sheet in near real time. The approach reportedly pushes driver adoption above 90% within a week, compared to 50–70% for custom applications, since drivers use a familiar platform with no installation required. Google Sheets handles dependent reporting formulas, SLA-breach flags, pivot tables, and automated client emails, while Drive stores proof-of-delivery photos. The full architecture, including known pitfalls such as unofficial API ban risks and audit-log requirements, is documented on the MageSheet blog.

0
ProgrammingDEV Community ·

HTML5 Dialog Element Lets Developers Build Accessible Modals Without Libraries

Developers often rely on third-party JavaScript libraries to create modal popups, which can bloat bundle sizes and harm accessibility for keyboard and screen reader users. The native HTML5 dialog element offers a built-in alternative that requires only semantic HTML, minimal JavaScript, and basic CSS. The browser's built-in .showModal() and .close() methods handle visibility states automatically, eliminating the need for manual class toggling. Notably, focus trapping within the modal is managed natively by the browser, improving accessibility compliance out of the box. A working demo and public code repository have been shared to help developers adopt this approach.

0
ProgrammingDEV Community ·

University Student Builds Fragrance-Themed Browser Arcade With 6 Games and AI Concierge

Ibrahim, a university student and self-described fragrance enthusiast, built a browser-based platform called 'recommendmeafragrance' for the DEV Weekend Challenge's Passion prompt. The platform features six daily mini-games built around real perfume data, including notes, brands, release years, and price tiers. Games include a Wordle-style fragrance guesser, a note-based reveal game, and a feature that lets users pick notes to discover which existing perfume they have effectively invented. All games feed into a personal virtual shelf that tracks discovered fragrances and maintains daily streaks to encourage return visits. An AI Concierge is also available, allowing users to describe their mood or preferences and receive tailored fragrance recommendations.

0
ProgrammingDEV Community ·

Why Building a DAO Is Far Harder Than Issuing a Token

Tokens and DAOs are often seen as straightforward tools for decentralized ownership and governance, but they involve deep technical challenges around design, security, and financial management. A poorly designed token that bundles governance power, economic utility, and access rights into one instrument can make the entire system fragile and vulnerable to manipulation. Concentrated token distribution among founders or early insiders can undermine decentralization in practice, enabling small groups to capture governance and control treasuries or protocol upgrades. On-chain voting carries its own risks, including flash loan attacks, vote buying, and low-participation exploits, requiring safeguards like timelocks, multisig controls, and emergency pause mechanisms. Treasury management adds further complexity, as DAO funds spanning tokens, stablecoins, and cross-chain assets demand structured spending controls, transparent accounting, and robust multi-signature execution to remain secure.