惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
量子位
GbyAI
GbyAI
腾讯CDC
T
Tailwind CSS Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Jina AI
Jina AI
IT之家
IT之家
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
iOS 26 Liquid Glass Gotcha: Adjacent Buttons Silently Swa...
Daksh Gargas · 2026-05-02 · via DEV Community

Daksh Gargas

We shipped a login screen on iOS 26 with two buttons styled using the new .glassEffect() API. Signup worked. Login didn't. No crash, no warning, no error -- just... nothing happened when you tapped it.

It took longer to find than I'd like to admit.

The Setup

Two buttons stacked vertically, 26pt apart. Standard VStack layout:

VStack(spacing: 26) {
    Spacer()

    Button {
        store.send(.signupButtonTapped)
    } label: {
        Text("Sign Up")
            .padding()
            .frame(width: buttonWidth, height: 55)
    }
    .glassEffect(.clear.interactive())
    .buttonStyle(.plain)

    Button {
        store.send(.loginButtonTapped)
    } label: {
        Text("Log In")
            .padding()
            .frame(width: buttonWidth, height: 50)
    }
    .glassEffect(.clear.interactive())
    .buttonStyle(.plain)
}

Enter fullscreen mode Exit fullscreen mode

App's Screenshot

Signup button: works fine. Login button: completely dead. Identical code, identical modifiers, only position differs.

The Cause

When you call .glassEffect(.clear.interactive()) without specifying a shape, the glass platter defaults to a rectangle. iOS 26's Liquid Glass system automatically merges adjacent glass surfaces that are close enough together into a single interactive group.

Once merged, the .interactive() gesture handler routes taps to the first view in the hierarchy -- in this case, the signup button. The login button's taps are silently consumed by the merged glass group and never reach the button's action.

The merging is by design -- Apple wants glass elements to feel like one fluid surface. But the gesture routing side effect is brutal to debug because there's zero feedback that anything went wrong.

The Fix

Specify an explicit shape with the in: parameter:

// Before (broken)
.glassEffect(.clear.interactive())

// After (works)
.glassEffect(.clear.interactive(), in: .capsule)

Enter fullscreen mode Exit fullscreen mode

That's it. One parameter. Giving each button a distinct glass shape prevents the automatic merge, so each button gets its own gesture handler.

A Reusable Modifier

If you're wrapping glass effects in a ViewModifier for backward compatibility (which you should), make sure to include the shape:

struct GlassButtonModifier: ViewModifier {
    func body(content: Content) -> some View {
        if #available(iOS 26.0, *) {
            content.glassEffect(.clear.interactive(), in: .capsule)
        } else {
            content
                .background(.ultraThinMaterial, in: Capsule())
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

When to Watch Out

This will bite you whenever:

  • Two or more .glassEffect() views are adjacent (VStack, HStack, ZStack)
  • You're using .interactive() for the press/bounce feedback
  • You haven't specified a shape with in:

It's especially dangerous because the first button always works -- so you might not catch it until a user reports that a specific button is dead.

TL;DR

Merges? Taps work?
.glassEffect(.clear.interactive()) Yes (rectangle, auto-merges) Only first button
.glassEffect(.clear.interactive(), in: .capsule) No (distinct shapes) All buttons

Always pass a shape to .glassEffect() when using .interactive() on adjacent views. Future you will thank present you.

Sources: