HomeiOS DevelopmentSwiftUI IOS 26 - Menu button floats outdoors its container throughout choice...

SwiftUI IOS 26 – Menu button floats outdoors its container throughout choice animation


Do not even know find out how to clarify this…
On IOS 26, in a scrollable view that accommodates a Menu, if I begin scrolling the view earlier than the menu choice animation finishes (roughly inside ~1 second after tapping an choice), the Menu icon quickly mispositions: it shifts relative to its container and seems to “float” outdoors of the format bounds. As soon as the animation completes or scrolling stops, it snaps again, however in the course of the interplay the button is visibly indifferent from the container/alignment.

This isn’t anticipated conduct proper?? That is taking place in each menu in my venture, even in menus utilized in a toolbar of a sheet, when dragging the sheet after choice, the identical drawback happens. I connected some gifs of various instances.

SwiftUI IOS 26 – Menu button floats outdoors its container throughout choice animation

Reproduction in swiftui app
Pattern for testing:

import SwiftUI

struct ContentView: View {
    personal let gadgets = (1...30).map { "Merchandise ($0)" }

       var physique: some View {
           NavigationStack {
               ScrollView {
                   LazyVStack(alignment: .main, spacing: 12, pinnedViews: []) {
                       HStack {
                           Textual content("Scrollable header")
                               .font(.headline)

                           Spacer()

                           Menu {
                               Button("Possibility 1") {
                                   // deal with choice 1
                               }
                               Button("Possibility 2") {
                                   // deal with choice 2
                               }
                           } label: {
                               Picture(systemName: "ellipsis.circle")
                                   .imageScale(.giant)
                                   .padding(8)
                           }
                           .menuStyle(.button)
                           .buttonStyle(.plain)
                           .accessibilityLabel("Extra choices")
                       }
                       .padding(.horizontal)
                       .padding(.high, 8)

                       ForEach(gadgets, id: .self) { merchandise in
                           Textual content(merchandise)
                               .body(maxWidth: .infinity, alignment: .main)
                               .padding(.horizontal)
                               .padding(.vertical, 12)
                               .background(.background)
                               .overlay(alignment: .backside) {
                                   Divider()
                               }
                       }
                   }
               }
               .navigationTitle("Objects")
               .background(Shade(.systemGroupedBackground))
           }
       }
}

#Preview {
    ContentView()
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments